text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
--- title: GetVehicleModelCount description: Gets the model count of a vehicle model. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Gets the model count of a vehicle model. ## Parameters | Name | Description | |---------|--------------------------------------------------------| | modelid | The ID of the [vehicle model](../resources/vehicleid). | ## Examples ```c public OnGameModeInit() { CreateVehicle(560, 2112.7607, -1308.3751, 23.6797, 90.0000, -1, -1, 100); CreateVehicle(560, 2104.5730, -1308.3313, 23.6797, 90.0000, -1, -1, 100); CreateVehicle(560, 2120.3616, -1308.4973, 23.6797, 90.0000, -1, -1, 100); new modelid = 560; printf("Vehicle model: %d - model count: %d", modelid, GetVehicleModelCount(modelid)); // Vehicle model: 560 - model count: 3 } ``` ## Related Functions - [CreateVehicle](CreateVehicle): Create a vehicle. - [GetVehicleModelsUsed](GetVehicleModelsUsed): Get the number of used vehicle models on the server.
openmultiplayer/web/docs/scripting/functions/GetVehicleModelCount.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleModelCount.md", "repo_id": "openmultiplayer", "token_count": 391 }
293
--- title: GetVehicleSirenState description: Gets the siren state of the vehicle. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Gets the siren state of the vehicle. ## Parameters | Name | Description | |-----------|------------------------| | vehicleid | The ID of the vehicle. | ## Return Values Returns the vehicle siren state. ## Examples ```c public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new bool:sirenState = GetVehicleSirenState(vehicleid); SendClientMessage(playerid, 0xFFFF00FF, "Vehicle siren state: %s", sirenState ? "On" : "Off"); return 1; } ``` ## Related Functions - [SetVehicleParamsSirenState](SetVehicleParamsSirenState): Turn the siren for a vehicle on or off. - [ToggleVehicleSirenEnabled](ToggleVehicleSirenEnabled): Turn the siren for a vehicle on or off. - [IsVehicleSirenEnabled](IsVehicleSirenEnabled): Checks if a vehicle siren is on or off. - [GetPlayerSirenState](GetPlayerSirenState): Gets the siren state of the player's vehicle.
openmultiplayer/web/docs/scripting/functions/GetVehicleSirenState.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleSirenState.md", "repo_id": "openmultiplayer", "token_count": 350 }
294
--- title: HasGameText description: Does the player currently have text in the given gametext style displayed? tags: ["player"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Does the player currently have text in the given gametext style displayed? | Name | Description | |----------|------------------------------------------------------------| | playerid | The ID of the player to check the gametext for. | | style | The [style](../resources/gametextstyles) of text to check. | ## Returns This function returns **true** if the player has gametext, or **false** if it is not. ## Examples ```c public OnPlayerConnect(playerid) { GameTextForPlayer(playerid, "Welcome to the server!", 5000, 3); if (HasGameText(playerid, 3)) { // Do something } return 1; } ``` ## Related Functions - [GameTextForPlayer](GameTextForPlayer): Display gametext to a player. - [HideGameTextForPlayer](HideGameTextForPlayer): Stop showing a gametext style to a player. - [GameTextForAll](GameTextForAll): Display gametext to all players. - [HideGameTextForAll](HideGameTextForAll): Stop showing a gametext style for all players. - [GetGameText](GetGameText): Gets all the information on the given game text style.
openmultiplayer/web/docs/scripting/functions/HasGameText.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/HasGameText.md", "repo_id": "openmultiplayer", "token_count": 436 }
295
--- title: IsAdminTeleportAllowed description: Checks if the RCON admins allowed to teleport by right-clicking on the map. tags: [] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Checks if the RCON admins allowed to teleport by right-clicking on the map. ## Returns true: Allowed. false: Not allowed. ## Examples ```c if (IsAdminTeleportAllowed()) { // Do something } ``` ## Related Functions - [AllowAdminTeleport](AllowAdminTeleport): Determine whether RCON admins will be teleported to their waypoint when they set one. - [AllowPlayerTeleport](AllowPlayerTeleport): Toggle waypoint teleporting for players. - [IsPlayerAdmin](IsPlayerAdmin): Checks if a player is logged into RCON.
openmultiplayer/web/docs/scripting/functions/IsAdminTeleportAllowed.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsAdminTeleportAllowed.md", "repo_id": "openmultiplayer", "token_count": 214 }
296
--- title: IsPlayerConnected description: Checks if a player is connected (if an ID is taken by a connected player). tags: ["player"] --- ## Description Checks if a player is connected (if an ID is taken by a connected player). | Name | Description | | -------- | ------------------------------ | | playerid | The ID of the player to check. | ## Returns **true** - Player is connected. **false** - Player is NOT connected. ## Examples ```c KillPlayer(playerid) { if (!IsPlayerConnected(playerid)) { printf("Player ID %i is not connected!", playerid); } else { SetPlayerHealth(playerid, 0.0); } } ``` ## Notes :::tip This function can be omitted in a lot of cases. Many other functions already have some sort of connection check built in. ::: ## Related Functions - [IsPlayerAdmin](IsPlayerAdmin): Checks if a player is logged into RCON. ## Related Callbacks - [OnPlayerConnect](../callbacks/OnPlayerConnect): Called when a player connects to the server. - [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect): Called when a player leaves the server.
openmultiplayer/web/docs/scripting/functions/IsPlayerConnected.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsPlayerConnected.md", "repo_id": "openmultiplayer", "token_count": 361 }
297
--- title: IsPlayerObjectMoving description: Checks if the given player objectid is moving. tags: ["player", "object", "playerobject"] --- ## Description Checks if the given player objectid is moving. | Name | Description | | -------- | ---------------------------------------------------- | | playerid | The ID of the player whose player-object is checked. | | objectid | The player objectid you want to check if is moving. | ## Returns 1 if the player object is moving, 0 if not. ## Examples ```c new gPlayerObject[MAX_PLAYERS]; public OnPlayerConnect(playerid) { gPlayerObject[playerid] = CreatePlayerObject(playerid, 2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); MovePlayerObject(playerid, gPlayerObject[playerid], 2001.195679, 1547.113892, 10.000000, 2.0); if (IsPlayerObjectMoving(playerid, gPlayerObject[playerid])) { StopPlayerObject(playerid, gPlayerObject[playerid]); } return 1; } ``` ## Related Functions - [CreatePlayerObject](CreatePlayerObject): Create an object for only one player. - [DestroyPlayerObject](DestroyPlayerObject): Destroy a player object. - [IsValidPlayerObject](IsValidPlayerObject): Checks if a certain player object is vaild. - [MovePlayerObject](MovePlayerObject): Move a player object. - [StopPlayerObject](StopPlayerObject): Stop a player object from moving. - [SetPlayerObjectPos](SetPlayerObjectPos): Set the position of a player object. - [SetPlayerObjectRot](SetPlayerObjectRot): Set the rotation of a player object. - [GetPlayerObjectPos](GetPlayerObjectPos): Locate a player object. - [GetPlayerObjectRot](GetPlayerObjectRot): Check the rotation of a player object. - [AttachPlayerObjectToPlayer](AttachObjectToPlayer): Attach a player object to a player. - [CreateObject](CreateObject): Create an object. - [DestroyObject](DestroyObject): Destroy an object. - [IsValidObject](IsValidObject): Checks if a certain object is vaild. - [MoveObject](MoveObject): Move an object. - [IsObjectMoving](IsObjectMoving): Check if the object is moving. - [StopObject](StopObject): Stop an object from moving. - [SetObjectPos](SetObjectPos): Set the position of an object. - [SetObjectRot](SetObjectRot): Set the rotation of an object. - [GetObjectPos](GetObjectPos): Locate an object. - [GetObjectRot](GetObjectRot): Check the rotation of an object. - [AttachObjectToPlayer](AttachObjectToPlayer): Attach an object to a player. ## Related Callbacks - [OnPlayerObjectMoved](../callbacks/OnPlayerObjectMoved): Called when a player-object stops moving.
openmultiplayer/web/docs/scripting/functions/IsPlayerObjectMoving.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsPlayerObjectMoving.md", "repo_id": "openmultiplayer", "token_count": 768 }
298
--- title: IsValidGangZone description: Check if the gangzone valid tags: ["gangzone"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Check if the gangzone valid. | Name | Description | | ----------- | -------------------------- | | zoneid | The ID of the gangzone. | ## Returns **true** - The gangzone is valid. **false** - The gangzone is not valid. ## Related Functions - [GangZoneDestroy](GangZoneDestroy): Destroy a gangzone. - [GangZoneShowForPlayer](GangZoneShowForPlayer): Show a gangzone for a player. - [GangZoneShowForAll](GangZoneShowForAll): Show a gangzone for all players. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Hide a gangzone for a player. - [GangZoneHideForAll](GangZoneHideForAll): Hide a gangzone for all players. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Make a gangzone flash for a player. - [GangZoneFlashForAll](GangZoneFlashForAll): Make a gangzone flash for all players. - [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Stop a gangzone flashing for a player. - [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Stop a gangzone flashing for all players.
openmultiplayer/web/docs/scripting/functions/IsValidGangZone.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsValidGangZone.md", "repo_id": "openmultiplayer", "token_count": 380 }
299
--- title: IsVehicleOccupied description: Check if a vehicle is occupied. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Check if a vehicle is occupied. ## Parameters | Name | Description | |-----------|------------------------| | vehicleid | The ID of the vehicle. | ## Return Values **true** - Vehicle is occupied. **false** - Vehicle is not occupied. ## Examples ```c if (IsVehicleOccupied(vehicleid)) { // Vehicle is occupied } else { // Vehicle is not occupied } ``` ## Related Functions - [SetVehicleBeenOccupied](SetVehicleBeenOccupied): Sets the vehicle's occupancy.
openmultiplayer/web/docs/scripting/functions/IsVehicleOccupied.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsVehicleOccupied.md", "repo_id": "openmultiplayer", "token_count": 216 }
300
--- title: PlayerPlaySound description: Plays the specified sound for a player. tags: ["player"] --- ## Description Plays the specified sound for a player. For a library that lists all sounds, check out [this](https://github.com/WoutProvost/samp-sound-array). | Name | Description | | -------- | ------------------------------------------------------------ | | playerid | The ID of the player for whom to play the sound. | | soundid | The [sound](../resources/sound-ids) to play. | | Float:x | X coordinate for the sound to play at. (0.0 for no position) | | Float:y | Y coordinate for the sound to play at. (0.0 for no position) | | Float:z | Z coordinate for the sound to play at. (0.0 for no position) | ## Returns **true** - The function was executed successfully. **false** - The function failed to execute. This means the player is not connected. ## Examples ```c // player punching sound (fits for commands such as /slap well). The sound will be quiet, as the source is actually 10 meters above the player. PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0); ``` ## Notes :::tip Only use the coordinates if you want the sound to be played at a certain position. Set coordinates all to 0.0 to just play the sound. ::: ## Related Functions - [PlayCrimeReportForPlayer](PlayCrimeReportForPlayer): Play a crime report for a player. - [PlayAudioStreamForPlayer](PlayAudioStreamForPlayer): Plays a audio stream for a player. - [StopAudioStreamForPlayer](StopAudioStreamForPlayer): Stops the current audio stream for a player. ## Related Resources - [Sound IDs](../resources/sound-ids)
openmultiplayer/web/docs/scripting/functions/PlayerPlaySound.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/PlayerPlaySound.md", "repo_id": "openmultiplayer", "token_count": 530 }
301
--- title: PlayerTextDrawIsProportional description: Checks if a player-textdraw is proportional. tags: ["player", "textdraw", "playertextdraw"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Checks if a player-textdraw is proportional. ## Parameters | Name | Description | | ----------------- | --------------------------------------- | | playerid | The ID of the player. | | PlayerText:textid | The ID of the player-textdraw to check. | ## Return Values Returns **true** if the player-textdraw is proportional, otherwise **false**. ## Example Usage ```c new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) { welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); PlayerTextDrawSetProportional(playerid, welcomeText[playerid], true); PlayerTextDrawShow(playerid, welcomeText[playerid]); if (PlayerTextDrawIsProportional(playerid, welcomeText[playerid])) { // Player-Textdraw is proportional } else { // Player-Textdraw is not proportional } return 1; } ``` ## Related Functions - [PlayerTextDrawCreate](PlayerTextDrawCreate): Create a player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Destroy a player-textdraw. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Scale the text spacing in a player-textdraw to a proportional ratio. - [PlayerTextDrawColor](PlayerTextDrawColor): Set the color of the text in a player-textdraw. - [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): Set the color of a player-textdraw's box. - [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): Set the background color of a player-textdraw. - [PlayerTextDrawAlignment](PlayerTextDrawAlignment): Set the alignment of a player-textdraw. - [PlayerTextDrawFont](PlayerTextDrawFont): Set the font of a player-textdraw. - [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): Set the letter size of the text in a player-textdraw. - [PlayerTextDrawTextSize](PlayerTextDrawTextSize): Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable). - [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): Toggle the outline on a player-textdraw. - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Set the shadow on a player-textdraw. - [PlayerTextDrawUseBox](PlayerTextDrawUseBox): Toggle the box on a player-textdraw. - [PlayerTextDrawSetString](PlayerTextDrawSetString): Set the text of a player-textdraw. - [PlayerTextDrawShow](PlayerTextDrawShow): Show a player-textdraw. - [PlayerTextDrawHide](PlayerTextDrawHide): Hide a player-textdraw. - [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): Checks if a player-textdraw is shown for the player. - [IsValidPlayerTextDraw](IsValidPlayerTextDraw): Checks if a player-textdraw is valid.
openmultiplayer/web/docs/scripting/functions/PlayerTextDrawIsProportional.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/PlayerTextDrawIsProportional.md", "repo_id": "openmultiplayer", "token_count": 899 }
302
--- title: PutPlayerInVehicle description: Puts a player in a vehicle. tags: ["player", "vehicle"] --- ## Description Puts a player in a vehicle. | Name | Description | | --------- | ------------------------------------------- | | playerid | The ID of the player to put in a vehicle. | | vehicleid | The ID of the vehicle to put the player in. | | seatid | The ID of the seat to put the player in. | ## Returns **true** - The function was executed successfully. **false** - The function failed to execute. The player or vehicle don't exist. ## Examples ```c public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger) { PutPlayerInVehicle(playerid, vehicleid, 0); return 1; } ``` | ID | Seat | | --- | ---------------------------- | | 0 | Driver | | 1 | Front passenger | | 2 | Back-left passenger | | 3 | Back-right passenger | | 4+ | Passenger seats (coach etc.) | ## Notes :::tip You can use [GetPlayerVehicleSeat](GetPlayerVehicleSeat) in a loop to check if a seat is occupied by any players. ::: :::warning If the seat is invalid or is taken, will cause a crash when they EXIT the vehicle. ::: ## Related Functions - [RemovePlayerFromVehicle](RemovePlayerFromVehicle): Throw a player out of their vehicle. - [GetPlayerVehicleID](GetPlayerVehicleID): Get the ID of the vehicle the player is in. - [GetPlayerVehicleSeat](GetPlayerVehicleSeat): Check what seat a player is in. - [GetVehicleSeats](GetVehicleSeats): Gets the number of seats in the vehicle. ## Related Callbacks - [OnPlayerEnterVehicle](../callbacks/OnPlayerEnterVehicle): Called when a player starts to enter a vehicle.
openmultiplayer/web/docs/scripting/functions/PutPlayerInVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/PutPlayerInVehicle.md", "repo_id": "openmultiplayer", "token_count": 615 }
303
--- title: SendChat description: This will send a player text by the bot, just like using SendPlayerMessageToAll, but this function is to be used inside the NPC scripts. tags: [] --- ## Description This will send a player text by the bot, just like using [SendPlayerMessageToAll](../functions/SendPlayerMessageToAll), but this function is to be used inside the NPC scripts. | Name | Description | | ------------ | -------------------------------------------------- | | msg[] | The text to be sent by the NPC. | ## Examples ```c public OnPlayerDeath(playerid) { new string[80], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "Oh no %s! I didn't want you to die that way!", name); SendChat(string); return 1; } ``` ## Related Functions - [SendCommand](../functions/SendCommand): Sends a command as the NPC.
openmultiplayer/web/docs/scripting/functions/SendChat.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SendChat.md", "repo_id": "openmultiplayer", "token_count": 332 }
304
--- title: SetActorHealth description: Set the health of an actor. tags: ["actor"] --- <VersionWarn version='SA-MP 0.3.7' /> ## Description Set the health of an actor. | Name | Description | | ------------ | ----------------------------------------- | | actorid | The ID of the actor to set the health of. | | Float:health | The value to set the actors's health to. | ## Returns **true** - success **false** - failure (i.e. actor is not created). ## Examples ```c new gMyActor; public OnGameModeInit() { gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Actor as salesperson in Ammunation SetActorHealth(gMyActor, 100.0); return 1; } ``` ## Related Functions - [GetActorHealth](GetActorHealth): Get the health of an actor. - [SetActorInvulnerable](SetActorInvulnerable): Set actor invulnerable.
openmultiplayer/web/docs/scripting/functions/SetActorHealth.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetActorHealth.md", "repo_id": "openmultiplayer", "token_count": 317 }
305
--- title: SetObjectMoveSpeed description: Set the move speed of an object. tags: ["object"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Set the move speed of an object. | Name | Description | |-------------|-----------------------------------------------------------| | objectid | The ID of the object to set the move speed of. | | Float:speed | The speed at which to move the object (units per second). | ## Returns `true` - The function was executed successfully. `false` - The function failed to execute. The object specified does not exist. ## Examples ```c new objectid = CreateObject(985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MoveObject(objectid, 1003.3915, -643.3342, 114.5122, 0.8); SetObjectMoveSpeed(objectid, 1.5); // Move speed changed from 0.8 to 1.5 ``` ## Related Functions - [MoveObject](MoveObject): Move an object to a new position with a set speed. - [GetObjectMoveSpeed](GetObjectMoveSpeed): Get the move speed of an object. - [SetPlayerObjectMoveSpeed](SetPlayerObjectMoveSpeed): Set the move speed of a player-object.
openmultiplayer/web/docs/scripting/functions/SetObjectMoveSpeed.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetObjectMoveSpeed.md", "repo_id": "openmultiplayer", "token_count": 398 }
306
--- title: SetPlayerAdmin description: Sets the player as an RCON admin. tags: ["player", "rcon", "administration"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Sets the player as an RCON admin. | Name | Description | |------------|--------------------------------------------------------------------------| | playerid | The ID of the player. | | bool:admin | **true** for set as an RCON admin, **false** for remove from RCON admin. | ## Returns This function does not return any specific values. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/admin", true)) { SetPlayerAdmin(playerid, true); SendClientMessage(playerid, -1, "SERVER: You are now RCON admin!"); return 1; } return 0; } ``` ## Related Functions - [IsPlayerAdmin](IsPlayerAdmin): Check if a player is logged in as an RCON admin. ## Related Callbacks - [OnRconLoginAttempt](OnRconLoginAttempt): Called when an attempt to login to RCON is made.
openmultiplayer/web/docs/scripting/functions/SetPlayerAdmin.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerAdmin.md", "repo_id": "openmultiplayer", "token_count": 446 }
307
--- title: SetPlayerInterior description: Set a player's interior. tags: ["player"] --- ## Description Set a player's interior. A list of currently known interiors and their positions can be found here. | Name | Description | | ---------- | -------------------------------------------------------------------- | | playerid | The ID of the player to set the interior of. | | interiorid | The [interior ID](../resources/interiorids) to set the player in. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. This means the player is not connected. ## Examples ```c // Set player to default interior (outside) SetPlayerInterior(playerid, 0); ``` ## Related Functions - [GetPlayerInterior](GetPlayerInterior): Get the current interior of a player. - [LinkVehicleToInterior](LinkVehicleToInterior): Change the interior that a vehicle is seen in. - [OnPlayerInteriorChange](../callbacks/OnPlayerInteriorChange): Called when a player changes interior. ## Related Resources - [Interior IDs](../resources/interiorids)
openmultiplayer/web/docs/scripting/functions/SetPlayerInterior.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerInterior.md", "repo_id": "openmultiplayer", "token_count": 367 }
308
--- title: SetPlayerPosFindZ description: This sets the players position then adjusts the players z-coordinate to the nearest solid ground under the position. tags: ["player"] --- ## Description This sets the players position then adjusts the players z-coordinate to the nearest solid ground under the position. | Name | Description | | -------- | -------------------------------------------- | | playerid | The ID of the player to set the position of. | | Float:x | The X coordinate to position the player at. | | Float:y | The X coordinate to position the player at. | | Float:z | The Z coordinate to position the player at. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. This means the player specified does not exist. ## Examples ```c SetPlayerPosFindZ(playerid, 1234.5, 1234.5, 1000.0); ``` ## Notes :::warning This function does not work if the new coordinates are far away from where the player currently is. The Z height will be 0, which will likely put them underground. It is highly recommended that the [MapAndreas](https://github.com/philip1337/samp-plugin-mapandreas) or [ColAndreas](https://github.com/Pottus/ColAndreas) plugin be used instead. ::: ## Related Functions - [SetPlayerPos](SetPlayerPos): Set a player's position. ## Related Callbacks - [OnPlayerClickMap](../callbacks/OnPlayerClickMap): Called when a player sets a waypoint/target on the pause menu map.
openmultiplayer/web/docs/scripting/functions/SetPlayerPosFindZ.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerPosFindZ.md", "repo_id": "openmultiplayer", "token_count": 432 }
309
--- title: SetSVarString description: Set a string server variable. tags: ["server variable", "svar"] --- <VersionWarn version='SA-MP 0.3.7 R2' /> ## Description Set a string server variable. | Name | Description | | ---------------- | ------------------------------------------ | | const svar[] | The name of the server variable. | | const value[] | The string to be set. | | OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The variable name is null or over 40 characters. ## Examples ```c // set "Version" SetSVarString("Version", "0.3.7"); // will print version that server has new string[5 + 1]; GetSVarString("Version", string, sizeof(string)); printf("Version: %s", string); ``` ## Related Functions - [SetSVarInt](SetSVarInt): Set an integer for a server variable. - [GetSVarInt](GetSVarInt): Get a player server as an integer. - [GetSVarString](GetSVarString): Get the previously set string from a server variable. - [SetSVarFloat](SetSVarFloat): Set a float for a server variable. - [GetSVarFloat](GetSVarFloat): Get the previously set float from a server variable. - [DeleteSVar](DeleteSVar): Delete a server variable.
openmultiplayer/web/docs/scripting/functions/SetSVarString.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetSVarString.md", "repo_id": "openmultiplayer", "token_count": 450 }
310
--- title: SetVehicleParamsForPlayer description: Set the parameters of a vehicle for a player. tags: ["player", "vehicle"] --- ## Description Set the parameters of a vehicle for a player. | Name | Description | | ---------------- | -------------------------------------------------------------------------------------------------------- | | vehicle | The ID of the vehicle to set the parameters of. | | playerid | The ID of the player to set the vehicle's parameters for. | | bool:objective | 'false' to disable the objective or 'true' to show it. This is a bobbing yellow arrow above the vehicle. | | bool:doorslocked | 'false' to unlock the doors or 'true' to lock them. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The player and/or vehicle specified do not exist. ## Examples ```c // sometime earlier: SetVehicleParamsForPlayer(iPlayerVehicle, iPlayerID, true, false); // sometime later when you want the vehicle to respawn: new bool:iEngine, bool:iLights, bool:iAlarm, bool:iDoors, bool:iBonnet, bool:iBoot, bool:iObjective; GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, false); // Locks own car for all players, except the player who used the command. public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/lock", true)) { if (!IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle."); } for (new i = 0; i < MAX_PLAYERS; i++) { if (i == playerid) { continue; } SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), i, false, true); } return 1; } return 0; } // Will show vehicle markers for players streaming in for 0.3a+ new bool:iVehicleObjective[MAX_VEHICLES][2]; public OnGameModeInit() //Or another callback { new temp = AddStaticVehicleEx(400, 0.0, 0.0, 5.0, 0.0, 0, 0, -1); //ID 1 iVehicleObjective[temp][0] = true; //Marker iVehicleObjective[temp][1] = false; //Door Lock return 1; } stock SetVehicleParamsForPlayerEx(vehicleid, playerid, bool:objective, bool:doorslocked) { SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked); iVehicleObjective[vehicleid][0] = objective; iVehicleObjective[vehicleid][1] = doorslocked; } public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } //Top new myMarkedCar; public OnGameModeInit() //Or another callback { myMarkedCar = AddStaticVehicleEx(400, 0.0, 0.0, 5.0, 0.0, 0, 0, -1); // For example: Black Landstalker near Blueberry Acres return 1; } //Whatever your want public OnVehicleStreamIn(vehicleid, forplayerid) { if (vehicleid == myMarkedCar) { SetVehicleParamsForPlayer(myMarkedCar, forplayerid, true, false); // marker can be visible only if the vehicle streamed for player } return 1; } ``` ## Notes :::tip Vehicles must be respawned for the 'objective' to be removed. ::: :::warning You will have to reapply this function when [OnVehicleStreamIn](../callbacks/OnVehicleStreamIn) is called. ::: ## Related Functions - [SetVehicleParamsEx](SetVehicleParamsEx): Sets a vehicle's params for all players.
openmultiplayer/web/docs/scripting/functions/SetVehicleParamsForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetVehicleParamsForPlayer.md", "repo_id": "openmultiplayer", "token_count": 1548 }
311
--- title: ShowPlayerDialog description: Shows the player a synchronous (only one at a time) dialog box. tags: ["player", "dialog"] --- ## Description Shows the player a synchronous (only one at a time) dialog box. | Name | Description | | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------- | | playerid | The ID of the player to show the dialog to. | | dialogid | An ID to assign this dialog to, so responses can be processed. Max dialogid is 32767. Using negative values will close any open dialog. | | DIALOG_STYLE:style | The [style](../resources/dialogstyles) of the dialog. | | const title[] | The title at the top of the dialog. The length of the caption can not exceed more than 64 characters before it starts to cut off. | | const body[] | The text to display in the main dialog. Use \n to start a new line and \t to tabulate. | | const button1[] | The text on the left button. | | const button2[] | The text on the right button. Leave it blank ( "" ) to hide it. | | OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. This means the player is not connected. ## Examples ```c // Define the dialog IDs either with an enum: enum { DIALOG_NULL, DIALOG_LOGIN, DIALOG_WELCOME, DIALOG_WEAPONS } // Alternatively, using macros: #define DIALOG_NULL 0 #define DIALOG_LOGIN 1 #define DIALOG_WELCOME 2 #define DIALOG_WEAPONS 3 // Enums are recommended, as you don't have to keep track of used IDs. However, enums use memory to store the defines, whereas defines are processed in the 'pre-processor' (compiling) stage. // Example for DIALOG_STYLE_MSGBOX: ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Notice", "You are connected to the server", "Close", ""); // Example for DIALOG_STYLE_INPUT: ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Enter your password below:", "Login", "Cancel"); // Example for DIALOG_STYLE_LIST: ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "AK47\nM4\nSniper Rifle", "Option 1", "Option 2"); // Example for DIALOG_STYLE_PASSWORD: ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Enter your password below:", "Login", "Cancel"); // Example for DIALOG_STYLE_TABLIST: ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "Buy Weapon", "Deagle\t$5000\t100\nSawnoff\t$5000\t100\nPistol\t$1000\t50", "Select", "Cancel"); // Example for DIALOG_STYLE_TABLIST_HEADERS: ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Buy Weapon", "Weapon\tPrice\tAmmo\nDeagle\t$5000\t100\nSawnoff\t$5000\t100\nPistol\t$1000\t50", "Select", "Cancel"); ``` ## Notes :::tip It is recommended to use enumerations (see above) or definitions (#define) to determine which IDs dialogs have, to avoid confusion in the future. You should never use literal numbers for IDs - it gets confusing. ::: :::tip - Use color embedding for multiple colors in the text. - Using **-1** as dialogid closes all dialogs currently shown on the client's screen or you can use [HidePlayerDialog](HidePlayerDialog) function. ::: ## Related Functions - [GetPlayerDialogID](GetPlayerDialogID): Get the ID of the dialog currently show to the player. - [GetPlayerDialogData](GetPlayerDialogData): Get the data of the dialog currently show to the player. - [HidePlayerDialog](HidePlayerDialog): Hides the dialog currently show to the player. - [TextDrawShowForPlayer](TextDrawShowForPlayer): Show a textdraw for a certain player. ## Related Callbacks - [OnDialogResponse](../callbacks/OnDialogResponse): Called when a player responds to a dialog. ## Related Resources - [Dialog Style](../resources/dialogstyles) - [Escape Codes](../resources/escapecodes)
openmultiplayer/web/docs/scripting/functions/ShowPlayerDialog.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/ShowPlayerDialog.md", "repo_id": "openmultiplayer", "token_count": 1901 }
312
--- title: TextDrawBoxColor description: Adjusts the text box colour (only used if TextDrawUseBox 'use' parameter is 1). tags: ["textdraw"] --- ## Description Adjusts the text box colour (only used if TextDrawUseBox 'use' parameter is 'true'). | Name | Description | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Text:textid | The TextDraw to change | | boxColour | The colour. Opacity is set by the alpha intensity of colour (eg. color 0x000000FF has a solid black box opacity, whereas 0x000000AA has a semi-transparent black box opacity). | ## Returns This function does not return any specific values. ## Examples ```c new Text:gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(123.0, 123.0, "Example"); TextDrawUseBox(gMyTextdraw, true); TextDrawBoxColor(gMyTextdraw, 0xFFFFFFFF); return 1; } ``` ## Notes :::tip If you want to change the boxcolour of a textdraw that is already shown, you don't have to recreate it. Simply use [TextDrawShowForPlayer](TextDrawShowForPlayer)/[TextDrawShowForAll](TextDrawShowForAll) after modifying the textdraw and the change will be visible. ::: ## Related Functions - [TextDrawCreate](TextDrawCreate): Create a textdraw. - [TextDrawDestroy](TextDrawDestroy): Destroy a textdraw. - [TextDrawColor](TextDrawColor): Set the color of the text in a textdraw. - [TextDrawBackgroundColor](TextDrawBackgroundColor): Set the background color of a textdraw. - [TextDrawAlignment](TextDrawAlignment): Set the alignment of a textdraw. - [TextDrawFont](TextDrawFont): Set the font of a textdraw. - [TextDrawLetterSize](TextDrawLetterSize): Set the letter size of the text in a textdraw. - [TextDrawTextSize](TextDrawTextSize): Set the size of a textdraw box. - [TextDrawSetOutline](TextDrawSetOutline): Choose whether the text has an outline. - [TextDrawSetShadow](TextDrawSetShadow): Toggle shadows on a textdraw. - [TextDrawSetProportional](TextDrawSetProportional): Scale the text spacing in a textdraw to a proportional ratio. - [TextDrawUseBox](TextDrawUseBox): Toggle if the textdraw has a box or not. - [TextDrawSetString](TextDrawSetString): Set the text in an existing textdraw. - [TextDrawShowForPlayer](TextDrawShowForPlayer): Show a textdraw for a certain player. - [TextDrawHideForPlayer](TextDrawHideForPlayer): Hide a textdraw for a certain player. - [TextDrawShowForAll](TextDrawShowForAll): Show a textdraw for all players. - [TextDrawHideForAll](TextDrawHideForAll): Hide a textdraw for all players.
openmultiplayer/web/docs/scripting/functions/TextDrawBoxColor.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TextDrawBoxColor.md", "repo_id": "openmultiplayer", "token_count": 1050 }
313
--- title: TextDrawGetOutline description: Gets the thickness of a textdraw's text's outline. tags: ["textdraw"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Gets the thickness of a textdraw's text's outline. | Name | Description | | ----------- | -------------------------------------------------- | | Text:textid | The ID of the textdraw to get the outline size of. | ## Returns Returns the textdraw outline size. ## Examples ```c new Text:gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(100.0, 33.0, "Example TextDraw"); TextDrawSetOutline(gMyTextdraw, 1); new outline = TextDrawGetOutline(gMyTextdraw); // outline = 1 return 1; } ``` ## Related Functions - [TextDrawCreate](TextDrawCreate): Create a textdraw. - [TextDrawDestroy](TextDrawDestroy): Destroy a textdraw. - [TextDrawSetOutline](TextDrawSetOutline): Sets the thickness of a textdraw's text's outline. - [TextDrawColor](TextDrawColor): Set the color of the text in a textdraw. - [TextDrawBoxColor](TextDrawBoxColor): Set the color of the box in a textdraw. - [TextDrawBackgroundColor](TextDrawBackgroundColor): Set the background color of a textdraw. - [TextDrawAlignment](TextDrawAlignment): Set the alignment of a textdraw. - [TextDrawFont](TextDrawFont): Set the font of a textdraw. - [TextDrawLetterSize](TextDrawLetterSize): Set the letter size of the text in a textdraw. - [TextDrawTextSize](TextDrawTextSize): Set the size of a textdraw box. - [TextDrawSetShadow](TextDrawSetShadow): Toggle shadows on a textdraw. - [TextDrawSetProportional](TextDrawSetProportional): Scale the text spacing in a textdraw to a proportional ratio. - [TextDrawUseBox](TextDrawUseBox): Toggle if the textdraw has a box or not. - [TextDrawSetString](TextDrawSetString): Set the text in an existing textdraw. - [TextDrawShowForPlayer](TextDrawShowForPlayer): Show a textdraw for a certain player. - [TextDrawHideForPlayer](TextDrawHideForPlayer): Hide a textdraw for a certain player. - [TextDrawShowForAll](TextDrawShowForAll): Show a textdraw for all players. - [TextDrawHideForAll](TextDrawHideForAll): Hide a textdraw for all players.
openmultiplayer/web/docs/scripting/functions/TextDrawGetOutline.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TextDrawGetOutline.md", "repo_id": "openmultiplayer", "token_count": 688 }
314
--- title: TextDrawSetPos description: Sets the position of a textdraw. tags: ["textdraw"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Sets the position (in-screen x & y) of a textdraw. | Name | Description | | ----------- | ---------------------------------------------- | | Text:textid | The ID of the textdraw to set the position of. | | Float:x | The X coordinate. | | Float:y | The Y coordinate. | ## Examples ```c new Text:gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(100.0, 33.0, "Example TextDraw"); TextDrawSetPos(gMyTextdraw, 200.0, 50.0); return 1; } ``` ## Related Functions - [TextDrawCreate](TextDrawCreate): Create a textdraw. - [TextDrawDestroy](TextDrawDestroy): Destroy a textdraw. - [TextDrawGetPos](TextDrawGetPos): Gets the position of a textdraw. - [TextDrawColor](TextDrawColor): Set the color of the text in a textdraw. - [TextDrawBoxColor](TextDrawBoxColor): Set the color of the box in a textdraw. - [TextDrawBackgroundColor](TextDrawBackgroundColor): Set the background color of a textdraw. - [TextDrawAlignment](TextDrawAlignment): Set the alignment of a textdraw. - [TextDrawFont](TextDrawFont): Set the font of a textdraw. - [TextDrawLetterSize](TextDrawLetterSize): Set the letter size of the text in a textdraw. - [TextDrawTextSize](TextDrawTextSize): Set the size of a textdraw box. - [TextDrawSetOutline](TextDrawSetOutline): Choose whether the text has an outline. - [TextDrawSetProportional](TextDrawSetProportional): Scale the text spacing in a textdraw to a proportional ratio. - [TextDrawUseBox](TextDrawUseBox): Toggle if the textdraw has a box or not. - [TextDrawSetString](TextDrawSetString): Set the text in an existing textdraw. - [TextDrawShowForPlayer](TextDrawShowForPlayer): Show a textdraw for a certain player. - [TextDrawHideForPlayer](TextDrawHideForPlayer): Hide a textdraw for a certain player. - [TextDrawShowForAll](TextDrawShowForAll): Show a textdraw for all players. - [TextDrawHideForAll](TextDrawHideForAll): Hide a textdraw for all players.
openmultiplayer/web/docs/scripting/functions/TextDrawSetPos.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TextDrawSetPos.md", "repo_id": "openmultiplayer", "token_count": 737 }
315
--- title: TogglePlayerClock description: Toggle the in-game clock (top-right corner) for a specific player. tags: ["player"] --- ## Description Toggle the in-game clock (top-right corner) for a specific player. When this is enabled, time will progress at 1 minute per second. Weather will also interpolate (slowly change over time) when set using [SetWeather](SetWeather)/[SetPlayerWeather](SetPlayerWeather). | Name | Description | | ----------- | ------------------------------------------------------ | | playerid | The player whose clock you want to enable/disable | | bool:toggle | 'true' to show and 'false' to hide. Hidden by default. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The specified player does not exist. ## Examples ```c public OnPlayerConnect(playerid) { TogglePlayerClock(playerid, true); // Show the clock return 1; } ``` ## Notes :::tip - Time is not synced with other players! Time can be synced using [SetPlayerTime](SetPlayerTime). - Time will automatically advance 6 hours when the player dies. ::: ## Related Functions - [GetPlayerTime](GetPlayerTime): Get the time of a player. - [SetPlayerTime](SetPlayerTime): Set a player's time. - [SetWorldTime](SetWorldTime): Set the global server time.
openmultiplayer/web/docs/scripting/functions/TogglePlayerClock.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TogglePlayerClock.md", "repo_id": "openmultiplayer", "token_count": 412 }
316
--- title: acos description: Get the inversed value of a cosine in degrees. tags: ["math"] --- <LowercaseNote /> ## Description Get the inversed value of a cosine in degrees. In trigonometrics, arc cosine is the inverse operation of cosine. | Name | Description | | ----------- | ------------------------------------------------------------ | | Float:value | value whose arc cosine is computed, in the interval [-1,+1]. | ## Returns The angle in degrees, in the interval [0.0,180.0]. ## Examples ```c //The arc cosine of 0.500000 is 60.000000 degrees. public OnGameModeInit() { new Float:param, Float:result; param = 0.5; result = acos(param); printf("The arc cosine of %f is %f degrees.", param, result); return 1; } ``` ## Related Functions - [floatsin](floatsin): Get the sine from a specific angle. - [floatcos](floatcos): Get the cosine from a specific angle. - [floattan](floattan): Get the tangent from a specific angle. - [asin](asin): Get the inversed value of a sine in degrees. - [atan](atan): Get the inversed value of a tangent in degrees. - [atan2](atan2): Get the multi-valued inversed value of a tangent in degrees.
openmultiplayer/web/docs/scripting/functions/acos.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/acos.md", "repo_id": "openmultiplayer", "token_count": 426 }
317
--- title: fblockread description: This function allows you to read data from a file, without encoding and line terminators. tags: ["file management"] --- <LowercaseNote /> ## Description This function allows you to read data from a file, without encoding and line terminators | Name | Description | | ---------------------- | ------------------------------------- | | File:handle | File handle to use, opened by fopen() | | buffer | The buffer to save the read data in. | | size = sizeof (buffer) | The number of cells to read. | ## Returns The number of cells read. Zero, if the file end has been reached. ## Examples ```c // Define "some_enum" enum _:some_enum { some_data1, some_data2[20], Float:some_data3 } // Declare "some_data" new some_data[some_enum]; // ... // Open "file.bin" in "read only" mode new File:handle = fopen("file.bin", io_read); // Declare "file_len" new file_len; // Check, if "file.bin" is open if (handle) { // Success // Get the file length of "file.bin" file_len = flength(handle); // If file is equally larger than the array if (file_len == (some_enum*4)) { // Success // Read from "file.bin" into "some_data" fblockread(handle, some_data); } else { // Error print("\"file.bin\" is not compatible with the array."); } // Close "file.bin" fclose(handle); } else { // Error print("Failed to open \"file.bin\"."); } ``` ## Notes :::warning Using an invalid handle will crash your server! Get a valid handle by using [fopen](fopen) or [ftemp](ftemp). ::: ## Related Functions - [fopen](fopen): Open a file. - [fclose](fclose): Close a file. - [ftemp](ftemp): Create a temporary file stream. - [fremove](fremove): Remove a file. - [fwrite](fwrite): Write to a file. - [fread](fread): Read a file. - [fputchar](fputchar): Put a character in a file. - [fgetchar](fgetchar): Get a character from a file. - [fblockwrite](fblockwrite): Write blocks of data into a file. - [fseek](fseek): Jump to a specific character in a file. - [flength](flength): Get the file length. - [fexist](fexist): Check, if a file exists. - [fmatch](fmatch): Check, if patterns with a file name matches. - [ftell](ftell): Get the current position in the file. - [fflush](fflush): Flush a file to disk (ensure all writes are complete). - [fstat](fstat): Return the size and the timestamp of a file. - [frename](frename): Rename a file. - [fcopy](fcopy): Copy a file. - [filecrc](filecrc): Return the 32-bit CRC value of a file. - [diskfree](diskfree): Returns the free disk space. - [fattrib](fattrib): Set the file attributes. - [fcreatedir](fcreatedir): Create a directory.
openmultiplayer/web/docs/scripting/functions/fblockread.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/fblockread.md", "repo_id": "openmultiplayer", "token_count": 1022 }
318
--- title: floatfract description: Get the fractional part of a float. tags: ["math", "floating-point"] --- <LowercaseNote /> ## Description Get the fractional part of a float. This means the value of the numbers after the decimal point. | Name | Description | | ----------- | ---------------------------------------- | | Float:value | The float to get the fractional part of. | ## Returns The fractional part of the float, as a float value. ## Examples ```c new Float:fFract = floatfract(3.14159); // returns 0.14159 ``` ## Related Functions - [floatround](floatround): Convert a float to an integer (rounding).
openmultiplayer/web/docs/scripting/functions/floatfract.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/floatfract.md", "repo_id": "openmultiplayer", "token_count": 215 }
319
--- title: frename description: Rename a file. tags: ["file management"] --- <VersionWarn version='omp v1.1.0.2612' /> <LowercaseNote /> ## Description Rename a file. | Name | Description | | --------------- | --------------------------------------------------------------- | | const oldname[] | The current name of the file, optionally including a full path. | | const newname[] | The new name of the file, optionally including a full path. | ## Returns **true** on success, **false** on failure. ## Examples ```c if (frename("example.txt", "file.txt")) { // Success printf("File \"example.txt\" renamed to \"file.txt\" successfully."); } else { // Error print("The file \"example.txt\" does not exists, or can't be opened."); } ``` ## Related Functions - [fopen](fopen): Open a file. - [fclose](fclose): Close a file. - [ftemp](ftemp): Create a temporary file stream. - [fremove](fremove): Remove a file. - [fwrite](fwrite): Write to a file. - [fputchar](fputchar): Put a character in a file. - [fgetchar](fgetchar): Get a character from a file. - [fblockwrite](fblockwrite): Write blocks of data into a file. - [fblockread](fblockread): Read blocks of data from a file. - [fseek](fseek): Jump to a specific character in a file. - [flength](flength): Get the file length. - [fexist](fexist): Check, if a file exists. - [fmatch](fmatch): Check, if patterns with a file name matches. - [ftell](ftell): Get the current position in the file. - [fflush](fflush): Flush a file to disk (ensure all writes are complete). - [fstat](fstat): Return the size and the timestamp of a file. - [fcopy](fcopy): Copy a file. - [filecrc](filecrc): Return the 32-bit CRC value of a file. - [diskfree](diskfree): Returns the free disk space. - [fattrib](fattrib): Set the file attributes. - [fcreatedir](fcreatedir): Create a directory.
openmultiplayer/web/docs/scripting/functions/frename.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/frename.md", "repo_id": "openmultiplayer", "token_count": 658 }
320
--- title: max description: Return the highest of two numbers. tags: ["core"] --- <LowercaseNote /> ## Description Function used to compare the values. | Name | Description | | ------ | ----------------------- | | value1 | Value 1 (a) to compare. | | value2 | Value 2 (b) to compare. | ## Returns The higher value of `value1` and `value2` If both are equivalent, `value1` is returned. ## Examples ```c public OnGameModeInit() { new a, b, result; a = 5; b = 10; result = max(a, b); printf("max(%d, %d) = %d", a, b, result); // Since b is bigger than a so result will be 10. return 1; } ``` ## Related Functions - [min](min): Compare and get the minimum value.
openmultiplayer/web/docs/scripting/functions/max.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/max.md", "repo_id": "openmultiplayer", "token_count": 268 }
321
--- title: strdel description: Delete part of a string. tags: ["string"] --- <LowercaseNote /> ## Description Delete part of a string. | Name | Description | | -------- | ---------------------------------------------- | | string[] | The string to delete part of. | | start | The position of the first character to delete. | | end | The position of the last character to delete. | ## Returns This function does not return any specific values. ## Examples ```c new string[42] = "We will delete everything apart from this"; strdel(string, 0, 37); // string is now "this" ``` ## Related Functions - [strcmp](strcmp): Compare two strings to check if they are the same. - [strfind](strfind): Search for a string in another string. - [strins](strins): Insert text into a string. - [strlen](strlen): Get the length of a string. - [strmid](strmid): Extract part of a string into another string. - [strpack](strpack): Pack a string into a destination string. - [strval](strval): Convert a string into an integer. - [strcat](strcat): Concatenate two strings into a destination reference.
openmultiplayer/web/docs/scripting/functions/strdel.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/strdel.md", "repo_id": "openmultiplayer", "token_count": 368 }
322
--- title: "Control Structures" description: An overview of control structures in the Pawn language --- ## Conditionals ### if An if statement checks if something is true and does something if it is. ```c new a = 5; if (a == 5) { print("a is 5"); } ``` The code within the brackets after the "if" is called the condition, there are a number of different things you can test for (see operators). In the example above both "a" and 5 are symbols, functions can also be symbols: ```c if (SomeFunction() == 5) { print("SomeFunction() is 5"); } ``` That will test the return value of SomeFunction (see below) against 5. You can also combine checks to check multiple things: ```c new a = 5, b = 3; if (a == 5 && b != 3) { print("Won't be printed"); } ``` That example checks that a is equal to 5 AND b is not equal to 3, however b is 3 so the check fails. ```c new a = 5, b = 3; if (a == 5 || b != 3) { print("Will be printed"); } ``` That examples checks that a is equal to 5 OR b is not equal to 3, b equals 3 so that part fails\* however a is 5 so that part is true, we are using || (or) so only one part needs to be true (if both are true the statement is still true, this is slightly different to the linguistic meaning of "or" meaning only one or the other), so the if statement is true. Also it is possible to chain the comparisons together without the explicit AND-ing of two different comparisons. ```c new idx = 3; if (0 < idx < 5) { print("idx is greater than 0 and less than 5!"); } ``` ### Operators The following are symbols you can use in comparisons and their explanations. Some have been used in examples already. | Operator | Meaning | Usage | | ------------ | ----------------------------------------------------------------- | ------------------------------------------------------------ | | == | Left is equal to Right | if (Left == Right) | | != | Left is not equal to Right | if (Left != Right) | | > | Left is greater than Right | if (Left > Right) | | >= | Left is greater than or equal to Right | if (Left >= Right) | | < | Left is less than Right | if (Left < Right) | | <= | Left is less than or equal to Right | if (Left <= Right) | | && | and | if (Left && Right) | | &#124;&#124; | or | if (Left &#124;&#124; Right) | | ! | not | if (!Variable) | | | nor | if (!(Left &#124;&#124; Right)) | | | nand | if (!(Left && Right)) | | | exclusive or (xor, eor) - only one or the other is true, not both | if (!(Left && Right) && (Left &#124;&#124;Right)) | | | not exclusive or (nxor, neor) - both or neither are true | if ((Left && Right) &#124;&#124; !(Left &#124;&#124; Right)) | ### Brackets The other main aspect of if statements is brackets, these control the order things are done in: ```c new a = 3, b = 3, c = 1; if (a == 5 && b == 3 || c == 1) { print("Will this be called?"); } ``` There are two ways of looking at the above statement: ```c if ((a == 5 && b == 3) || c == 1) ``` And: ```c if (a == 5 && (b == 3 || c == 1)) ``` The first version will check if a is 5 and b is 3, if that is false (i.e. one or both of them are not their respective values) it will check if c is 1. (a == 5 && b == 3) is false as you should know from above, so you replace that group with FALSE: ```c if (FALSE || c == 1) ``` We know FALSE cannot be true (as it is not true by definition), however c is 1 so that half is true and, as we're using an OR in between the whole statement is true. The second version checks if a is 5, if it is it checks if either b is 3 or c is 1. The game will do the a == 5 part first but for clarity we'll do it backwards. (b == 3 || c == 1) is true, both halves are true, although only one needs to be, so going into our if statement we have: ```c if (a == 5 && TRUE) ``` (a == 5) is false, because a is 3, so we have: ```c if (FALSE && TRUE) ``` Obviously FALSE is false so that statement cannot be true, so the check will fail. This little example shows how using brackets can change the outcome of a check, without brackets the compiler will be the first of the two versions demonstrated but that cannot always be guaranteed so you should always use brackets, even if just to clarify what is going on to other people. - (b != 3) in the OR example doesn't actually fail as it's never called, the compiler orders the code using a thing called short-circuiting, as the first part is already true there's no point checking the second part as it won't affect the final outcome, but if it did check it it would fail. ### else else basically does something if an if check fails: ```c new a = 5; if (a == 3) // False { print("Won't be called"); } else { print("Will be called as the check failed"); } ``` ### else if An else if is a check which occurs if the first if check fails to check something else: ```c new a = 5; if (a == 1) { print("Will be called if a is 1"); } else if (a == 5) { print("Will be called if a is 5"); } else { print("All other numbers"); } ``` You can have an many of these as you like (you can only have one if and one else in a group of checks): ```c new a = 4; if (a == 1) { // False } else if (a == 2) { // False } else if (a == 3) { // False } else if (a == 4) { // True } else { // False } ``` else ifs will only check the value as it was when the ifs start, so you can't do: ```c new a = 5; if (a == 5) { // Will be called a = 4; } else if (a == 4) { // Won't be called because the first check didn't fail, even though a is now 4 } ``` To get round this you would simply make the else if an if. ### ?: '?' and ':' together are called a triadic operator, they basically act as an if statement inside another statement: ```c new a, b = 3; if (b == 3) { a = 5; } else { a = 7; } ``` That's a simple example to assign a variable based on another variable, however it can be made much shorter: ```c new a, b = 3; a = (b == 3) ? (5) : (7); ``` The part before the '?' is the conditional, this is exactly the same as a normal conditional. The part between the '?' and the ':' is the value to return if the condition is true, the other part is the value to return if the condition is false. You can stack them up the same as else ifs too: ```c new a, b = 3; if (b == 1) { a = 2; } else if (b == 2) { a = 3; } else if (b == 3) { a = 4; } else { a = 5; } ``` Can be written as: ```c new a, b = 3; a = (b == 1) ? (2) : ((b == 2) ? (3) : ((b == 3) ? (4) : (5))); ``` This is actually more similar to doing: ```c new a, b = 3; if (b == 1) { a = 2; } else { if (b == 2) { a = 3; } else { if (b == 3) { a = 4; } else { a = 5; } } } ``` But they're equivalent (in this example anyway). ## Loops ### While "while" loops do something while the condition specified is true. A condition is exactly the same format as the condition in an if statement, it is just checked repeatedly and the code done if it is true every time it is checked: ```c new a = 9; while (a < 10) { // Code in the loop a++; } // Code after the loop ``` That code will check if 'a' is less than 10. If it is, the code inside the braces (a++;) will be executed, thus incrementing 'a'. When the closing brace is reached, code execution jumps back to the check and does it again, this time the check will fail as 'a' is 10 and execution will jump to after the loop. If 'a' started out as 8, the code would be run twice etc. ### for() A "for" loop is essentially a compressed "while" loop. A "for" statement has three sections; initialization, condition and finalization. As a "for" loop, the "while" example above would be written: ```c for (new a = 9; a < 10; a++) { // Code in the loop } // Code after the loop ``` That's a simple code to loop through all players: ```c for(new i,a = GetMaxPlayers(); i < a; i++) { if (IsPlayerConnected(i)) { //do something } } ``` Any of the conditions can be omitted simply by putting no code in them: ```c new a = 9; for ( ; a < 10; ) { // Code in the loop a++; } // Code after the loop ``` This example makes it a little easier to show how a "for" loop matches up to a "while" loop. There are two very slight differences between the two "for" loops given. The first is that the second example declares 'a' outside the "for" loop, this means it can be used outside the "for" loop, in the first example 'a's scope (the section of code for which a variable exists) is only inside the loop. The second difference is that the a++ in the second example is actually done slightly before the a++ in the first example, 99% of the time this doesn't make any difference, the only time it matters is when you're using 'continue' (see below), 'continue' will call the a++ in the first example, but will skip it in the second example. ### do-while A do-while loop is a while loop where the condition comes after the code inside the loop instead of before. This means that the code inside will always be executed at least once because it is done before the check is done: ```c new a = 10; do { // Code inside the loop a++; } while (a < 10); // Note the semi-colon // Code after the loop ``` If that was a standard while loop a would not be incremented as the (a < 10) check is false, but here it's incremented before the check. If a started as 9 the loop would also only be done once, 8 - twice etc. ### if-goto This is essentially what the loops above compile to, the use of goto is generally discouraged however it's interesting to see exactly what a loop is doing: ```c new a = 9; loop_start: if (a < 10) { // Code in the loop a++; goto loop_start; } // Code after the loop ``` ### OBOE OBOE stands for Off By One Error. This is a very common mistake where a loop runs for one too many or two few times. E.g: ```c new a = 0, b[10]; while (a <= sizeof (b)) { b[a] = 0; } ``` This very simple example demonstrates one of the most common OBOEs, at first glance people may think this will loop through all the contents of b and set them to 0, however this loop will actually run 11 times and try access b[10], which doesn't exist (it would be the 11th slot in b starting from 0), thus can cause all sorts of problems. This is known as an Out Of Bounds (OOB) error. You have to be especially careful of OBOEs when using do-while loops as they ALWAYS run at least once. ## Switch ### switch A switch statement is basically a structured if/else if/else system (similar to how for is a structured while). The easiest way to explain it is with an example: ```c new a = 5; switch (a) { case 1: { // Won't be called } case 2: { // Won't be called } case 5: { // Will be called } default: { // Won't be called } } ``` This is functionally equivalent to: ```c new a = 5; if (a == 1) { // Won't be called } else if (a == 2) { // Won't be called } else if (a == 5) { // Will called } else { // Won't be called } ``` However it is slightly clearer to see what is going on. An important thing to note here is the different ways in which ifs and switches are processed: ```c switch (SomeFunction()) { case 1: {} case 2: {} case 3: {} } ``` That will call SomeFunction() ONCE and compare it's result 3 times. ```c if (SomeFunction() == 1) {} else if (SomeFunction() == 2) {} else if (SomeFunction() == 3) {} ``` That will call SomeFunction() three times, which is very inefficient, a switch is more like doing: ```c new result = SomeFunction(); if (result == 1) {} else if (result == 2) {} else if (result == 3) {} ``` For those of you who know C the PAWN switch is slightly different, the individual conditions are NOT fall-through and are bound by braces so there's no need for break statements. ### case case statements (the "case X:" parts of the switch statement) can have other options besides a single number. You can compare a value to a list of numbers (replacing fall-through in C) or even a range of values: ```c case 1, 2, 3, 4: ``` This case will trigger if the symbol being tested is 1, 2, 3, or 4, it's the same as doing: ```c if (bla == 1 || bla == 2 || bla == 3 || bla == 4) ``` but far more concise. Numbers in lists do not have to be consecutive, in fact if they are it's better to do: ```c case 1 .. 4: ``` This case will do exactly the same as above but by checking a range instead of a list, it is the same as doing: ```c if (bla >= 1 && bla <= 4) ``` ```c new a = 4; switch (a) { case 1 .. 3: { } case 5, 8, 11: { } case 4: { } default: { } } ``` ### default This is the equivalent to else in if statements, it does something if all the other case statements failed. ## Single line statements ### goto goto is essentially a jump, it goes to a label without question (i.e. there's no condition to need to be true). You can see an example above in the if-goto loop. ```c goto my_label; // This section will be jumped over my_label: // Labels end in a colon and are on their own line // This section will be processed as normal ``` The use of gotos is widely discouraged due to their effect on program flow. ### break break breaks out of a loop, ending it prematurely: ```c for (new a = 0; a < 10; a++) { if (a == 5) break; } ``` This loop will go 6 times but code after the break will only be executed 5 times. ### continue continue basically skips a loop iteration ```c for (new a = 0; a < 3; a++) { if (a == 1) continue; printf("a = %d", a); } ``` That will give the output of: ```c a = 0 a = 2 ``` The continue basically jumps to the closing brace of the loop, as hinted at above you have to be careful when using continue with some loops: ```c new a = 0; while (a < 3) { if (a == 1) continue; printf("a = %d", a); a++; } ``` This looks very similar to the other example however this time the continue will skip the a++; line, so the loop will get stuck in an infinite loop as a will always be 1. ### return return stops a function and goes back to the point in code which called the function in the first place: ```c main() { print("1"); MyFunction(1); print("3"); } MyFunction(num) { if (num == 1) { return; } print("2"); } ``` That code will give an output of: 1 3 Because the print("2"); line will never be reached. You can also use return to return a value: ```c main() { print("1"); if (MyFunction(1) == 27) { print("3"); } } MyFunction(num) { if (num == 1) { return 27; } print("2"); return 0; } ``` That code will give the same output as above, however note that an additional return has been added to the end of the function. The end of a function has a return implied at it, however this return has no value, you cannot return a value and not return a value from the same function so we must explicitly return a value. The symbol you return can be a number, a variable or even another function (in which case the other function will be called, it will return a value (it MUST return a value if you use it as a return value) and that value will be returned from the first function. You can also store return values for later use: ```c main() { print("1"); new ret = MyFunction(1); if (ret == 27) { print("3"); } } MyFunction(num) { if (num == 1) { return 27; } print("2"); return 0; } ```
openmultiplayer/web/docs/scripting/language/ControlStructures.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/language/ControlStructures.md", "repo_id": "openmultiplayer", "token_count": 6646 }
323
# Statements --- A statement may take one or more lines, whereas one line may contain two or more statements. Control flow statements (if, if–else, for, while, do–while and switch) may be nested. **Statement label** A label consists of an identifier followed by a colon (“:”). A label is a “jump target” of the goto statement. Each statement may be preceded by a label. There must be a statement after the label; an empty statement is allowed. The scope of a label is the function in which it is declared (a goto statement cannot therefore jump out off the current function to another function). **Compound statement** A compound statement is a series of zero or more statements surrounded by braces ({ and }). The final brace (}) should not be followed by a semicolon. Any statement may be replaced by a compound statement. A compound statement is also called a block. A compound statement with zero statements is a special case, and it is called an “empty statement”. **Expression statement** Any expression becomes a statement when a semicolon (“;”) is appended to it. An expression also becomes a statement when only white space follows it on the line and the expression cannot be extended over the next line. **Empty statement** An empty statement performs no operation and consists of a compound block with zero statements; that is, it consists of the tokens “{ }”. Empty statements are used in control flow statements if there is no action (e.g. while (!iskey()) {}) or when defining a label just before the closing brace of a compound statement. An empty statement does not end with a semicolon. **assert** _expression_ Aborts the program with a run-time error if the expression evaluates to logically “false”. **break** Terminates and exits the smallest enclosing do, for or while statement from any point within the loop other than the logical end. The break statement moves program control to the next statement outside the loop. **continue** Terminates the current iteration of the smallest enclosing do, for or while statement and moves program control to the condition part of the loop. If the looping statement is a for statement, control moves to the third expression in the for statement (and thereafter to the second expression). **do** _statement_ **while** ( _expression_ ) Executes a statement before the condition part (the while clause) is evaluated. The statement is repeated while the condition is logically “true”. The statement is at least executed once. **exit** _expression_ Abort the program. The expression is optional, but it must start on the same line as the exit statement if it is present. The exit instruction returns the expression value (plus the expression tag) to the host application, or zero if no exit expression is present. The significance and purpose of exit codes is implementation defined. **for** ( _expression 1_ ; _expression 2_ ; _expression 3_ ) _statement_ All three expressions are optional. *expression 1* Evaluated only once, and before entering the loop. This expression may be used to initialize a variable. This expression may also hold a variable declaration, using the new syntax. A variable declared in this expression exists only in the for loop. *expression 2* Evaluated before each iteration of the loop and ends the loop if the expression results to logically “false”. If omitted, the result of expression 2 is assumed to be logically “true”. *expression 3* Evaluated after each execution of the statement. Program control moves from expression 3 to expression 2 for the next (conditional) iteration of the loop. The statement for( ; ; ) is equivalent with while (true). **goto** _label_ Moves program control (unconditionally) to the statement that follows the specified label. The label must be within the same function as the goto statement (a goto statement cannot jump out of a function). **if** ( _expression_ ) _statement 1_ **else** _statement 2_ Executes statement 1 if the expression results to logically “true”. The else clause of the if statement is optional. If the expression results to logically “false” and an else clause exists, the statement associated with the else clause (statement 2) executes. When if statements are nested and else clauses are present, a given else is associated with the closest preceding if statement in the same block. **return** _expression_ Terminates the current function and moves program control to the statement following the calling statement. The value of the expression is returned as the function result. The expression may be an array variable or a literal array. The expression is optional, but it must start on the same line as the return statement if it is present. If absent, the value of the function is zero. **sleep** _expression_ Abort the program, but leave it in a re-startable state. The expression is optional. If included, the sleep instruction returns the expression value (plus the expression tag) to the host application. The significance and purpose of exit codes/tags is implementation defined; typically, an application uses the sleep instruction to allow for light-weight multitasking of several concurrent pawn programs, or to implement “latent” functions. **state** ( _expression_ ) **automaton** :_name_ Changes the current state in the specified automaton. The expression between parentheses is optional; if it is absent, the parentheses must be omitted as well. The name of the automaton is optional as well, when changing the state of the default, anonymous, automaton; if the automaton name is absent, the colon (“:”) must be omitted as well. Below are two examples of unconditional state changes. The first is for the default automaton: ``` state handshake ``` and the second for a specific automaton: ``` state gps:handshake ``` Often, whether or not a state changes depends on parameters of the event or the condition of the automaton as a whole. Since conditional state changes are so frequent, the condition may be in the state instruction itself. ∗ The condition follows the keyword state, between parentheses. The state will only change if the condition is logically “true”. The state instruction causes an implied call to the entry function for the indicated state —if such entry function exists. **switch** ( _expression_ ) { _case list_ } Transfers control to different statements within the switch body depending on the value of the switch expression. The body of the switch statement is a compound statement, which contains a series of “case clauses”. Each “case clause” starts with the keyword case followed by a constant list and one statement. The constant list is a series of expressions, separated by comma’s, that each evaluates to a constant value. The constant list ends with a colon. To specify a “range” in the constant list, separate the lower and upper bounds of the range with a double period (“..”). An example of a range is: “case 1..9:”. The switch statement moves control to a “case clause” if the value of one of the expressions in the constant list is equal to the switch expression result. The “default clause” consists of the keyword default and a colon. The default clause is optional, but if it is included, it must be the last clause in the switch body. The switch statement moves control to the “default clause” is executed if none of the case clauses match the expression result. Example: --- ###### ∗ The alternative is to fold unconditional state changes in the common if–else construct. --- ```c switch (weekday(12,31,1999)) { case 0, 1: /* 0 == Saturday, 1 == Sunday */ print("weekend") case 2: print("Monday") case 3: print("Tuesday") case 4: print("Wednesday") case 5: print("Thursday") case 6: print("Friday") default: print("invalid week day") } ``` **while** ( _expression_ ) _statement_ Evaluates the expression and executes the statement if the expression result yields logically “true”. After the statement has executed, program control returns to the expression again. The statement is thus executed while the expression is true. --- `Identifiers: 97` `Example: 11 (assert)` `Example: 21 (break)` `Example: 27 (do while)` `Examples: 9, 11, 21 (for)` `Variable declarations: 62 (for)` `Example: 7 (if else)` `Examples: 11, 21 (return)` `See page 40 for examples of conditional state changes (state automaton)` `“entry” functions: 44 (state automaton)` `Examples: 7, 21, 26 (while)` --- [Go Back to Contents](00-Contents.md)
openmultiplayer/web/docs/scripting/language/reference/08-Statements.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/language/reference/08-Statements.md", "repo_id": "openmultiplayer", "token_count": 2582 }
324
--- title: Click Sources description: Click Sources --- :::info Below is a list of click sources used by [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer). As of right now, only one click source type exists. ::: | Value | Constant symbol | | ----- | ----------------------- | | 0 | CLICK_SOURCE_SCOREBOARD |
openmultiplayer/web/docs/scripting/resources/clicksources.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/clicksources.md", "repo_id": "openmultiplayer", "token_count": 102 }
325
--- title: Spectate Types description: Spectate Types used by GetPlayerSpectateType. tags: [] sidebar_label: Spectate Types --- :::info Spectate Types used by [GetPlayerSpectateType](../functions/GetPlayerSpectateType). ::: | Type | Value | |---------|-------| | None | 0 | | Vehicle | 1 | | Player | 2 |
openmultiplayer/web/docs/scripting/resources/spectatetypes.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/spectatetypes.md", "repo_id": "openmultiplayer", "token_count": 120 }
326
--- title: Vehicle Information Types description: Vehicle Information Type Constants. --- :::info A list of vehicle info types used by [GetVehicleModelInfo](../functions/GetVehicleModelInfo) can be found here. ::: | Vehicle Information Type | Description | | ------------------------------------- | ----------------------------------------------------------------- | | `VEHICLE_MODEL_INFO_SIZE` | The vehicle size | | `VEHICLE_MODEL_INFO_FRONTSEAT` | Position of the front seat \* | | `VEHICLE_MODEL_INFO_REARSEAT` | Position of the rear seat \* | | `VEHICLE_MODEL_INFO_PETROLCAP` | Position of the fuel cap \* | | `VEHICLE_MODEL_INFO_WHEELSFRONT` | Position of the front wheels \* | | `VEHICLE_MODEL_INFO_WHEELSREAR` | Position of the rear wheels \* | | `VEHICLE_MODEL_INFO_WHEELSMID` | Position of the middle wheels (applies to vehicles which have more than 4 wheels) \* | | `VEHICLE_MODEL_INFO_FRONT_BUMPER_Z` | Height of the front bumper. [GetVehicleModelInfo](../functions/GetVehicleModelInfo) will only return the Z value when used | | `VEHICLE_MODEL_INFO_REAR_BUMPER_Z` | Height of the rear bumper. [GetVehicleModelInfo](../functions/GetVehicleModelInfo) will only return the Z value when used | \* These values are calculated from the pivot (usually the center) of the vehicle.
openmultiplayer/web/docs/scripting/resources/vehicleinformationtypes.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/vehicleinformationtypes.md", "repo_id": "openmultiplayer", "token_count": 754 }
327
--- title: OnActorStreamIn description: This callback is called when an actor is streamed in by a player's client. tags: [] --- <VersionWarn name='callback' version='SA-MP 0.3.7' /> <div dir="rtl" style={{ textAlign: "right" }}> ## الوصف يتم استدعاء هذا الاستدعاء أو الكال باك عند تدفق الممثل (أكتور) بواسطة كلاينت اللاعب | Name | Description | | ----------- | ------------------------------------------------------------- | | actorid | ايدي الممثل الذي تم تدفقه للاعب. | | forplayerid | هوية اللاعب الذي قام بتدفق الممثل (أكتور) | ## Returns دائمًا يتم استدعاؤه أولاً في الفلترسكربتات. ## أمثلة </div> ```c public OnActorStreamIn(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Actor %d is now streamed in for you.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` <div dir="rtl" style={{ textAlign: "right" }}> ## Notes <TipNPCCallbacks/> ## الاستدعاءات او كالباكات ذات الصلة قد تكون الاستدعاءات التالية مفيدة، حيث أنها ذات صلة بهذا الاستدعاء بطريقة أو بأخرى. - [OnActorStreamOut](OnActorStreamOut): يتم استدعاؤه عندما يتم تدفق ممثل (أكتور) خارج كلاينت اللاعب. </div>
openmultiplayer/web/docs/translations/ar/scripting/callbacks/OnActorStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ar/scripting/callbacks/OnActorStreamIn.md", "repo_id": "openmultiplayer", "token_count": 789 }
328
--- title: OnActorStreamIn description: Ovaj callback se poziva kada se aktor pojavi u igračevom klijentu. tags: [] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Ovaj callback se poziva kada se aktor pojavi u igračevom klijentu. | Ime | Deskripcija | | ----------- | ---------------------------------------------- | | actorid | ID aktora koji se pojavi u igračevom klijentu. | | forplayerid | ID igrača kod kojeg se pojavljuje aktor. | ## Returns Uvijek je pozvana prva u filterskripti. ## Primjeri ```c public OnActorStreamIn(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Aktor %d se pojavio u tvom klijentu.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Bilješke :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnActorStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnActorStreamIn.md", "repo_id": "openmultiplayer", "token_count": 414 }
329
--- title: OnPlayerClickPlayerTextDraw description: Ovaj callback je pozvan kada igrač klikne na player-textdraw. tags: ["player", "textdraw", "playertextdraw"] --- ## Deskripcija Ovaj callback je pozvan kada igrač klikne na player-textdraw. Nije pozvan kada igrač napusti select mode (ESC) - međutim, OnPlayerClickTextDraw jeste. | Ime | Deskripcija | | ------------ | ---------------------------------------------- | | playerid | ID igrača koji je selektovao player-textdraw. | | playertextid | ID player-textdrawa kojeg je igrač selektovao. | ## Returns Uvijek je pozvana prva u filterskripti tako da return-ovanje 1 tu blokira ostale skripte da je vide. ## Primjeri ```c new PlayerText:gPlayerTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) { // Napravi textdraw gPlayerTextDraw[playerid] = CreatePlayerTextDraw(playerid, 10.000000, 141.000000, "MyTextDraw"); PlayerTextDrawTextSize(playerid, gPlayerTextDraw[playerid], 60.000000, 20.000000); PlayerTextDrawAlignment(playerid, gPlayerTextDraw[playerid],0); PlayerTextDrawBackgroundColor(playerid, gPlayerTextDraw[playerid],0x000000ff); PlayerTextDrawFont(playerid, gPlayerTextDraw[playerid], 1); PlayerTextDrawLetterSize(playerid, gPlayerTextDraw[playerid], 0.250000, 1.000000); PlayerTextDrawColor(playerid, gPlayerTextDraw[playerid], 0xffffffff); PlayerTextDrawSetProportional(playerid, gPlayerTextDraw[playerid], 1); PlayerTextDrawSetShadow(playerid, gPlayerTextDraw[playerid], 1); // Postavi ga mogućim za selektovati PlayerTextDrawSetSelectable(playerid, gPlayerTextDraw[playerid], 1); // Prikaži ga igraču PlayerTextDrawShow(playerid, gPlayerTextDraw[playerid]); return 1; } public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (newkeys == KEY_SUBMISSION) { SelectTextDraw(playerid, 0xFF4040AA); } return 1; } public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) { if (playertextid == gPlayerTextDraw[playerid]) { SendClientMessage(playerid, 0xFFFFFFAA, "Kliknuo si na textdraw."); CancelSelectTextDraw(playerid); return 1; } return 0; } ``` ## Zabilješke :::warning Kada igrač pritisne ESC da prekine selektovanje textdraw-a, OnPlayerClickTextDraw biva pozvan sa textdraw IDem od 'INVALID_TEXT_DRAW'. OnPlayerClickPlayerTextDraw neće biti pozvan. ::: ## Srodne Funkcije - [PlayerTextDrawSetSelectable](../functions/PlayerTextDrawSetSelectable.md): Postavlja da li je player-textraw moguć za selektovanje ili ne. - [OnPlayerClickTextDraw](OnPlayerClickTextDraw.md): Pozvana kada igrač klikne na player-textdraw. - [OnPlayerClickPlayer](OnPlayerClickPlayer.md): Pozvana kada jedan igrač klikne na drugog.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerClickPlayerTextDraw.md", "repo_id": "openmultiplayer", "token_count": 1063 }
330
--- title: OnPlayerInteriorChange description: Pozvan kada igrač promijeni enterijer. tags: ["player"] --- ## Deskripcija Pozvan kada igrač promijeni enterijer. Može biti izazvano od strane `SetPlayerInterior` funkcije ili kada igrač uđe/izađe iz izgrade(u zgradu). | Ime | DescripDeskripcijation | | ------------- | ------------------------------------------------------------- | | playerid | ID igrača koji je promijenio enterijer. | | newinteriorid | Interijer u kojem se igrač trenutno nalazi. | | oldinteriorid | Interijer u kojem se igrač nalazio prije nego je ušao u novi. | ## Returns Uvijek je pozvana prva u gamemode-u. ## Primjeri ```c public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { new string[42]; format(string, sizeof(string), "Otisao si iz enterijera ID %d u enterijer ID %d!", oldinteriorid, newinteriorid); SendClientMessage(playerid, COLOR_ORANGE, string); return 1; } ``` ## Srodne Funkcije - [SetPlayerInterior](../functions/SetPlayerInterior.md): Postavlja igraču enterijer. - [GetPlayerInterior](../functions/GetPlayerInterior.md): Dobijate trenutni enterijer igrača. - [LinkVehicleToInterior](../functions/LinkVehicleToInterior.md): Promijenite enterijer u kojem se nalazi vozilo. - [OnPlayerStateChange](OnPlayerStateChange.md): Pozvana kada igrač promijeni stanje.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerInteriorChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerInteriorChange.md", "repo_id": "openmultiplayer", "token_count": 598 }
331
--- title: OnPlayerText description: Pozvano kada igrač pošalje chat poruku. tags: ["player"] --- ## Deskripcija Pozvano kada igrač pošalje chat poruku. | Ime | Deskripcija | | -------- | -------------------------------- | | playerid | ID igrača koji je napisao tekst. | | text[] | Tekst kojeg je igrač napisao. | ## Returns Uvijek je pozvan prvo u filterskriptama tako da će return-ovanje 0 blokirati ostale skripte da ga vide. ## Primjeri ```c public OnPlayerText(playerid, text[]) { new pText[144]; format(pText, sizeof (pText), "(%d) %s", playerid, text); SendPlayerMessageToAll(playerid, pText); return 0; // ignore the default text and send the custom one } ``` ## Zabilješke :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije - [SendPlayerMessageToPlayer](../functions/SendPlayerMessageToPlayer.md): Forsira igrača da pošalje tekst drugom igraču. - [SendPlayerMessageToAll](../functions/SendPlayerMessageToAll.md): Forsira igrača da pošalje tekst svim igračima.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerText.md", "repo_id": "openmultiplayer", "token_count": 421 }
332
--- title: OnVehicleStreamOut description: Ovaj callback je pozvan kada se vozilo prestane pojavljivati u igračevom klijentu (previše je daleko i ne može da ga vidi). tags: ["vehicle"] --- ## Deskripcija Ovaj callback je pozvan kada se vozilo prestane pojavljivati u igračevom klijentu (previše je daleko i ne može da ga vidi). | Ime | Deskripcija | | ----------- | ------------------------------------------------------------- | | vehicleid | ID vozila koje se prestalo pojavljivati u igračevom klijentu. | | forplayerid | ID igrača u čijem se klijentu prestalo pojavljivati vozilo. | ## Returns Uvijek je pozvan prvo u filterskriptama. ## Primjeri ```c public OnVehicleStreamOut(vehicleid, forplayerid) { new string[48]; format(string, sizeof(string), "Vozilo %d se prestalo prikazivati u tvom klijentu", vehicleid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Zabilješke :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnVehicleStreamOut.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnVehicleStreamOut.md", "repo_id": "openmultiplayer", "token_count": 464 }
333
--- title: Attach3DTextLabelToPlayer description: Prikvači 3D tekst label za igrača. tags: ["player", "3dtextlabel"] --- ## Deskripcija Prikvači 3D tekst label za igrača. | Ime | Deskripcija | | --------- | -------------------------------------------------------------------------------------- | | Text3D:textid | ID 3D tekst labela kojeg želite prikvačiti. Returnovan(uzvraćen) od Create3DTextLabel. | | playerid | ID igrača za kojeg želite prikvačiti label. | | OffsetX | X kordinata igrača. | | OffsetY | Y kordinata igrača. | | OffsetZ | Z kordinata igrača. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija nije uspjela da se izvrši. To znači da igrač i/ili label ne postoje. ## Primjeri ```c public OnPlayerConnect(playerid) { new Text3D:textLabel = Create3DTextLabel("Hello, I am new here!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); Attach3DTextLabelToPlayer(textLabel, playerid, 0.0, 0.0, 0.7); return 1; } ``` ## Srodne Funkcije - [Create3DTextLabel](Create3DTextLabel): Kreiraj 3D text label. - [Delete3DTextLabel](Delete3DTextLabel): Izbriši a 3D text label. - [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Prikvači 3D text label za vozilo. - [Update3DTextLabelText](Update3DTextLabelText): Promijeni boju 3D text labela. - [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Kreiraj 3D text label za jednog igrača. - [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): Obriši igračev 3D text label. - [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): Promijeni tekst igračevog 3D text labela.
openmultiplayer/web/docs/translations/bs/scripting/functions/Attach3DTextLabelToPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/Attach3DTextLabelToPlayer.md", "repo_id": "openmultiplayer", "token_count": 955 }
334
--- title: CancelSelectTextDraw description: Prekid selektovanja textdrawa pomoću miša. tags: ["textdraw"] --- ## Deskripcija Cancel textdraw selection with the mouse | Ime | Deskripcija | | -------- | ------------------------------------------------------------------- | | playerid | ID igrača za kojeg bi se trebala prekinuti selekcija textdrawova | ## Returns Ova funkcija ne vraća nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/cancelselect", true)) { CancelSelectTextDraw(playerid); SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: TextDraw selection disabled!"); return 1; } return 0; } ``` ## Zabilješke :::warning \*Ova funkcija poziva OnPlayerClickTextDraw sa INVALID_TEXT_DRAW (65535). Korištenje ove funkcije unutar OnPlayerClickTextDraw bez zahvatanja ovog slučaja izazvati će to da će klijenti ući u beskonačnu petlju. ::: ## Srodne Funkcije - [SelectTextDraw](SelectTextDraw): Omogućuje igraču da pomoću miša selektuje textdraw. - [TextDrawSetSelectable](TextDrawSetSelectable): Određuje da li je textdraw moguće selektovati putem SelectTextDraw. - [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): Poziva se kada igrač klikne na textdraw.
openmultiplayer/web/docs/translations/bs/scripting/functions/CancelSelectTextDraw.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/CancelSelectTextDraw.md", "repo_id": "openmultiplayer", "token_count": 556 }
335
--- title: CreateVehicle description: Creates a vehicle in the world. tags: ["vehicle"] --- ## Deskripcija Creates a vehicle in the world. Can be used in place of AddStaticVehicleEx at any time in the script. | Ime | Deskripcija | | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | vehicletype | Model vozila. | | Float:X | X kordinata vozila. | | Float:Y | Y kordinata vozila. | | Float:Z | Z kordinata vozila. | | Float:rotation | Rotacija/smjer vozila. | | [color1](../resources/vehiclecolorid) | ID Primarne boje. | | [color2](../resources/vehiclecolorid) | ID Sekundarne boje | | respawn_delay | Razmak do ponovnog respawnovanja automobila bez vozača u sekundi. Korištenjem -1 spriječit će ponovno respawnovanje vozila. | | bool:addsiren | Ima zadanu vrijednost 'false'. Omogućuje vozilu da ima sirenu, pod uvjetom da vozilo ima sirenu(trubu H). | ## Returns ID vozila koji je kreiran (1 do MAX_VEHICLES). INVALID_VEHICLE_ID (65535) ako vozilo nije kreirano (dostignut je limit vozila ili unesen nevažeći model vozila). 0 Ako vozilo nije kreirano (Prošla su vozila 538 ili 537, a to su vozovi). ## Primjeri ```c public OnGameModeInit() { // Dodaj Hydra (520) u igru sa respawn vremenom od 60 sekundi CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, -1, -1, 60); return 1; } ``` ## Zabilješke :::warning Vozovi se mogu dodati samo sa AddStaticVehicle i AddStaticVehicleEx. ::: ## Srodne Funkcije - [DestroyVehicle](DestroyVehicle): Uništi vozilo. - [AddStaticVehicle](AddStaticVehicle): Dodaj statično vozilo. - [AddStaticVehicleEx](AddStaticVehicleEx): Dodaj statično vozilo sa prilagođenim vremenom respawnovanja. - [GetVehicleParamsSirenState](GetVehicleParamsSirenState): Provjeri da li je sirena vozila upaljena ili ugašena. - [OnVehicleSpawn](../callbacks/OnVehicleSpawn): Pozvano kada se vozilo respawnuje. - [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): Pozvano kada se sirena vozila upali ili ugasi.
openmultiplayer/web/docs/translations/bs/scripting/functions/CreateVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/CreateVehicle.md", "repo_id": "openmultiplayer", "token_count": 2086 }
336
--- title: DisablePlayerCheckpoint description: Onemogućava (skriva/uništava) checkpoint postavljenog za igrača. tags: ["player", "checkpoint"] --- ## Deskripcija Onemogućava (skriva/uništava) checkpoint postavljenog za igrača. Igrači mogu odjednom postaviti samo jedan checkpoint. Prije postavljanja drugog ne treba onemogućavati checkpointe. | Ime | Deskripcija | | -------- | -------------------------------------------- | | playerid | ID igrača čiji checkpoint treba onemogućiti. | ## Returns 1: Funkcija uspješno izvršena. Uspješno se također returna/vraća ako igrač nema trenutno prikazan checkpoint 0: Funkcija neuspješno izvršena. Ovo znači da igrač nije konektovan. ## Primjeri ```c public OnPlayerEnterCheckpoint(playerid) { GivePlayerMoney(playerid, 10000); DisablePlayerCheckpoint(playerid); return 1; } ``` ## Srodne Funkcije - [SetPlayerCheckpoint](SetPlayerCheckpoint): Kreiraj checkpoint za igrača. - [IsPlayerInCheckpoint](IsPlayerInCheckpoint): Provjeri da li je igrač u checkpointu. - [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): Kreiraj race checkpoint za igrača. - [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): Onemogući igračev trenutni race checkpoint. - [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): Provjeri da li je igrač u race checkpointu. - [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): Pozvano kada igrač uđe u checkpoint. - [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): Pozvano kada igrač napusti checkpoint. - [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): Pozvano kada igrač napusti race checkpoint. - [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): Pozvano kada igrač uđe u race checkpoint.
openmultiplayer/web/docs/translations/bs/scripting/functions/DisablePlayerCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/DisablePlayerCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 660 }
337
--- title: GameTextForAll description: Prikazuje 'game text' (tekst na ekranu) određeno vrijeme za sve igrače. tags: [] --- ## Deskripcija Prikazuje 'game text' (tekst na ekranu) određeno vrijeme za sve igrače. | Ime | Deskripcija | | -------------- | -------------------------------------------------------- | | const string[] | Tekst za prikazati. | | time | Trajanje teksta koji se prikazuje u milisekundama. | | style | [Stil](../resources/gametextstyles) teksta za prikazati. | ## Returns Ova funkcija uvijek returna (vraća) 1. ## Primjeri ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Ovaj primjer prikazuje veliki, bijeli tekst koji kaže // "[playerName] je preminuo" na ekranu svih, // nakon što je igrač umro ili ubijen. // Prikazuje se u obliku teksta 3, na 5 sekundi (5000 ms) new name[ 24 ], string[ 64 ]; GetPlayerName( playerid, name, 24 ); // Pravilno formatirajte preminulu poruku i pokažite je svima: format( string, sizeof(string), "~w~%s je umro", name ); GameTextForAll( string, 5000, 3 ); return 1; } ``` ## Zabilješke :::warning Imajte na umu da igrači mogu crashati zbog neparnog broja simbola tilde (~) koji se koriste u tekstu igre. Korištenje kodova u boji (npr. ~r~) izvan 255. znaka može srušiti client. ::: ## Srodne Funkcije - [GameTextForPlayer](GameTextForPlayer): Prikaži gametext igraču. - [TextDrawShowForAll](TextDrawShowForAll): Prikaži textdraw za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/GameTextForAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GameTextForAll.md", "repo_id": "openmultiplayer", "token_count": 738 }
338
--- title: GetActorVirtualWorld description: Dobij id virtual world-a određenog actora. tags: [] --- <VersionWarn version='SA-MP 0.3.7' /> ## Deskripcija Dobij id virtual world-a određenog actora. | Ime | Deskripcija | | ------- | ------------------------------------------------ | | actorid | ID actora za dobijanje id-a virtual world-a. | ## Returns Virtual World actora. Po defaultu je ovo 0. Također on uvijek returna 0 ako navedeni actor ne postoji. ## Primjeri ```c new MyActor; public OnGameModeInit() { MyActor = CreateActor(...); SetActorVirtualWorld(MyActor, 69); return 1; } // Negdje drugdje if (GetActorVirtualWorld(MyActor) == 69) { // Odradi nešto } ``` ## Srodne Funkcije - [SetActorVirtualWorld](SetActorVirtualWorld): Postavi wirtual world actoru.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetActorVirtualWorld.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetActorVirtualWorld.md", "repo_id": "openmultiplayer", "token_count": 340 }
339
--- title: GetPVarType description: Dobija tip (cijli broj, float ili string) igračeve varijable. tags: ["pvar"] --- ## Deskripcija Dobija tip (cijli broj, float ili string) igračeve varijable. | Ime | Deskripcija | | -------- | ------------------------------------------------------ | | playerid | ID igrača od čije igračeve varijable treba dobiti tip. | | varname | Ime igračeve varijable za dobiti tip. | ## Returns Returna/vraća tip PVar-a. Pogledaj tabelu ispod. ## Primjeri ```c stock PrintPVar(playerid, varname[]) { switch(GetPVarType(playerid, varname)) { case PLAYER_VARTYPE_NONE: { return 0; } case PLAYER_VARTYPE_INT: { printf("Cijelobrojni PVar '%s': %i", varname, GetPVarInt(playerid, varname)); } case PLAYER_VARTYPE_FLOAT: { printf("Float PVar '%s': %f", varname, GetPVarFloat(playerid, varname)); } case PLAYER_VARTYPE_STRING: { new varstring[256]; GetPVarString(playerid, varname, varstring); printf("String PVar '%s': %s", varname, varstring); } } return 1; } ``` ## Srodne Funkcije - [SetPVarInt](SetPVarInt): Postavi cijeli broj za igračevu varijablu. - [GetPVarInt](GetPVarInt): Dobij prethodno postavljeni cijeli broj iz igračeve varijable. - [SetPVarString](SetPVarString): Postavi string za igračevu varijablu. - [GetPVarString](GetPVarString): Dobij prethodno postavljeni string iz igračeve varijable. - [SetPVarFloat](SetPVarFloat): Postavi float za igračevu varijablu. - [GetPVarFloat](GetPVarFloat): Dobij prethodno postavljeni float iz igračeve varijable. - [DeletePVar](DeletePVar): Ukloni igračevu varijablu.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetPVarType.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPVarType.md", "repo_id": "openmultiplayer", "token_count": 861 }
340
--- title: GetPlayerVirtualWorld description: Dohvaća trenutni virtualni svijet u kojem se igrač nalazi. tags: ["player"] --- ## Deskripcija Dohvaća trenutni virtualni svijet u kojem se igrač nalazi. | Ime | Deskripcija | | -------- | ------------------------------------- | | playerid | ID igrača za dobiti virtualni svijet. | ## Returns ID virtualnog svijeta u kojem je igrač trenutno. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/world", true)) { new string[32]; format(string, sizeof(string), "Tvoj virtualni svijet: %i", GetPlayerVirtualWorld(playerid)); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } return 0; } ``` ## Zabilješke :::tip Virtualni svjetovi nisu isto šti i enterijeri. ::: ## Srodne Funkcije - [SetPlayerVirtualWorld](SetPlayerVirtualWorld): Postavite virtualni svijet igrača. - [GetVehicleVirtualWorld](GetVehicleVirtualWorld): Provjerite u kojem je virtualnom svijetu vozilo. - [GetPlayerInterior](GetPlayerInterior): Dobij trenutni enterijer igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerVirtualWorld.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerVirtualWorld.md", "repo_id": "openmultiplayer", "token_count": 471 }
341
--- title: GetVehicleComponentInSlot description: Dohvaća ID instalirane komponente (modshop mod(ifikacija)) na vozilu u određenom slotu. tags: ["vehicle"] --- ## Deskripcija Dohvaća ID instalirane komponente (modshop mod(ifikacija)) na vozilu u određenom slotu. | Ime | Deskripcija | | --------- | ------------------------------------------------------------------------ | | vehicleid | ID vozila za provjeriti komponentu. | | slot | [Slot komponente](../resources/Componentslots) za provjeriti komponente. | ## Returns ID instalirane komponente u određenom slotu. Returna/vraća 0 ako nema komponente u određenom slotu tog vozila, ili vozilo ne postoji. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/myspoiler", cmdtext) && IsPlayerInAnyVehicle(playerid)) { new component = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SPOILER); if (component == 1049) { SendClientMessage(playerid, -1, "Imaš Alien spoiler instaliran na vaš Elegy!"); } } } ``` ## Zabilješke :::warning Poznati Bug(ovi): Ne radi za CARMODTYPE_STEREO. Dijelove prednjeg branika spremljeni su u slot CARMODTYPE_FRONT_BUMPER. Ako su u vozilu instalirana oba, ova funkcija vraća samo ono zadnje instalirano. I stražnji branici spremljeni su u slot CARMODTYPE_REAR_BUMPER. Ako su u vozilu instalirana oba, ova funkcija vraća samo ono zadnje instalirano. Lijevi i desni "skirt" spremljeni su u slot CARMODTYPE_SIDESKIRT. Ako su u vozilu instalirana oba, ova funkcija vraća samo ono zadnje instalirano. ::: ## Srodne Funkcije - [AddVehicleComponent](AddVehicleComponent): Dodaje komponentu na vozilo. - [GetVehicleComponentType](GetVehicleComponentType): Provjeri tip komponente preko ID-a. - [OnVehicleMod](../callbacks/OnVehicleMod): Pozvano kada vozilo biva nadograđeno. - [OnEnterExitModShop](../callbacks/OnEnterExitModShop): Pozvano kada vozilo uđe ili izađe iz mod shopa.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleComponentInSlot.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleComponentInSlot.md", "repo_id": "openmultiplayer", "token_count": 921 }
342
--- title: GetVehicleVirtualWorld description: Dobij virtualni svijet vozila. tags: ["vehicle"] --- ## Deskripcija Dobij virtualni svijet vozila. | Ime | Deskripcija | | --------- | -------------------------------------------- | | vehicleid | ID vozila za dobiti njegov virtualni svijet. | ## Returns Virutalni svijet u kojem se vozilo nalazi. ## Primjeri ```c new vehicleWorld = GetVehicleVirtualWorld(vehicleid); SetPlayerVirtualWorld(playerid, vehicleWorld); ``` ## Srodne Funkcije - [SetVehicleVirtualWorld](SetVehicleVirtualWorld): Postavi virtualni svijet vozila. - [GetPlayerVirtualWorld](GetPlayerVirtualWorld): Provjerava u kojem je igrač virtualnom svijetu.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleVirtualWorld.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleVirtualWorld.md", "repo_id": "openmultiplayer", "token_count": 274 }
343
--- title: IsPlayerConnected description: Provjerava da li je igrač konektovan (Ako je ID uzet od stanje konektovanog igrača). tags: ["player"] --- ## Deskripcija Provjerava da li je igrač konektovan (Ako je ID uzet od stanje konektovanog igrača). | Ime | Deskripcija | | -------- | ---------------------- | | playerid | ID igrača za provjeru. | ## Returns 0: Igrač nije konektovan. 1: igrač JESTE konektovan. ## Primjeri ```c KillPlayer(playerid) { if (!IsPlayerConnected(playerid)) { printf("Igrač sa ID-em %i nije konektovan!", playerid); } else { SetPlayerHealth(playerid, 0); } } ``` ## Zabilješke :::tip Ova funkcija se u mnogim slučajevima može izostaviti. Mnoge druge funkcije već imaju ugrađenu neku vrstu provjere veze. ::: ## Srodne Funkcije - [IsPlayerAdmin](IsPlayerAdmin): Provjerava da li je igrač prijavljen/ulogovan u RCON. - [OnPlayerConnect](../callbacks/OnPlayerConnect): Pozvano kada se igrač konektuje na server. - [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect): Pozvano kada igrač napusti server.
openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerConnected.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerConnected.md", "repo_id": "openmultiplayer", "token_count": 479 }
344
--- title: IsVehicleStreamedIn description: Provjerava ako je vozilo učitano za igrača. tags: ["vehicle"] --- ## Deskripcija Provjerava ako je vozilo učitano za igrača. Samo vozila u blizini su učitana (vidljiva) za igrača. | Ime | Deskripcija | | ----------- | ---------------------- | | vehicleid | ID vozila za provjeru. | | forplayerid | ID igrača za provjeru. | ## Returns 0: Vozilo nije učitano za igrača, ili funkcija nije uspjela da se izvrši (igrač i/ili vozilo ne postoje). 1: Vozilo je učitano za igrača. ## Primjeri ```c new streamedVehicleCount; for(new v = 1; v <= MAX_VEHICLES; v++) { if (IsVehicleStreamedIn(v, playerid)) { streamedVehicleCount ++; } } new szString[144]; format(szString, sizeof(szString), "Trenutno imaš %i vozila učitanih u vašu igru.", streamedVehicleCount); SendClientMessage(playerid, -1, szString); ``` ## Srodne Funkcije - [IsPlayerStreamedIn](IsPlayerStreamedIn): Provjerava da li je igrač učitan kod drugog igrača. - [OnVehicleStreamIn](../callbacks/OnVehicleStreamIn): Pozvano kada se vozilo učita za igrača. - [OnVehicleStreamOut](../callbacks/OnVehicleStreamOut): Pozvano kada se vozilo iščita za igrača. - [OnPlayerStreamIn](../callbacks/OnPlayerStreamIn): Pozvano kada se igrač učita za drugog igrača. - [OnPlayerStreamOut](../callbacks/OnPlayerStreamOut): Pozvano kada se igrač iščita za drugog igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/IsVehicleStreamedIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/IsVehicleStreamedIn.md", "repo_id": "openmultiplayer", "token_count": 605 }
345
--- title: NetStats_MessagesSent description: Dobija broj poruka koje je server poslao igraču za reprodukciju. tags: [] --- ## Deskripcija Dobija broj poruka koje je server poslao igraču za reprodukciju. | Ime | Deskripcija | | -------- | ---------------------------- | | playerid | ID igrača za dobiti podatke. | ## Returns Broj poruka koje je server poslao igraču za reprodukciju. ## Primjeri ```c public OnPlayerCommandText(playerid,cmdtext[]) { if (!strcmp(cmdtext, "/msgsent")) { new szString[144]; format(szString, sizeof(szString), "Primio si %i network poruka.", NetStats_MessagesSent(playerid)); SendClientMessage(playerid, -1, szString); } return 1; } ``` ## Srodne Funkcije - [GetPlayerNetworkStats](GetPlayerNetworkStats): Dobija mrežne statistike igrača i pohranjuje ih u string. - [GetNetworkStats](GetNetworkStats): Dobija mrežne statistike servera i sprema ih u string. - [NetStats_GetConnectedTime](NetStats_GetConnectedTime): Dobij vrijeme za kojeg je igrač povezan na server. - [NetStats_MessagesReceived](NetStats_MessagesReceived): Dohvatite broj mrežnih poruka koje je server primio od igrača. - [NetStats_BytesReceived](NetStats_BytesReceived): Dohvatite količinu informacija (u bajtovima) koju je poslužitelj primio od igrača. - [NetStats_BytesSent](NetStats_BytesSent): Dohvatite količinu informacija (u bajtovima) koje je poslužitelj poslao uređaju za reprodukciju. - [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): Dohvatite broj mrežnih poruka koje je poslužitelj primio od igrača u posljednjoj sekundi. - [NetStats_PacketLossPercent](NetStats_PacketLossPercent): Dobijte packet loss procenat igrača. - [NetStats_ConnectionStatus](NetStats_ConnectionStatus): Dohvatite status veze igrača. - [NetStats_GetIpPort](NetStats_GetIpPort): Nabavite IP adresu i port igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/NetStats_MessagesSent.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/NetStats_MessagesSent.md", "repo_id": "openmultiplayer", "token_count": 758 }
346
--- title: PlayerTextDrawSetPreviewModel description: Postavlja player-textdrawu 3D pregled određenog ID-a modela. tags: ["player", "textdraw", "playertextdraw"] --- ## Deskripcija Postavlja player-textdrawu 3D pregled određenog ID-a modela. | Ime | Deskripcija | | ---------- | ------------------------------------------ | | playerid | ID igrača PlayerTextDraw-a. | | text | ID textdraw-a koji će prikazati 3D prikaz. | | modelindex | GTA SA ili SA:MP model ID za prikazati. | ## Returns 1: Funkcija uspješno izvršena. Ako je proslijeđen nevažeći ID modela 'success' (uspješno) je poslano, ali Model će se prikazati kao crno-žuti upitnik. 0: Funkcija neuspješno izvršena. Igrač i/ili textdraw ne postoje. ## Primjeri ```c new PlayerText: gTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) { gTextDraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "_"); PlayerTextDrawFont(playerid, gTextDraw[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW); PlayerTextDrawUseBox(playerid, gTextDraw[playerid], true); PlayerTextDrawBoxColor(playerid, gTextDraw[playerid], 0x000000FF); PlayerTextDrawTextSize(playerid, gTextDraw[playerid], 40.0, 40.0); PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 411); // Prikaži Infernus (model 411) //PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 0); //Prikaži model 0 (CJ Skin) //PlayerTextDrawSetPreviewModel(playerid, gTextDraw[playerid], 18646); //Prikaži model 18646 (police light object) PlayerTextDrawShow(playerid, gTextDraw[playerid]); return 1; } ``` ## Zabilješke :::warning Textdraw MORA koristiti tip fonta `TEXT_DRAW_FONT_MODEL_PREVIEW` kako bi ova funkcija imala efekta. ::: ## Srodne Funkcije - [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): Postavlja rotaciju 3D prikaza u player-textdrawu. - [PlayerTextDrawSetPreviewVehCol](PlayerTextDrawSetPreviewVehCol): Postavlja boju vozila 3D prikazu u player-textdrawu. - [PlayerTextDrawFont](PlayerTextDrawFont): Postavi font player-textdrawa. ## Related Callbacks - [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): Pozvano kada igrač klikne na player-textdraw.
openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawSetPreviewModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawSetPreviewModel.md", "repo_id": "openmultiplayer", "token_count": 882 }
347
--- title: RemoveVehicleComponent description: Ukloni komponentu sa vozila. tags: ["vehicle"] --- ## Deskripcija Ukloni komponentu sa vozila. | Ime | Deskripcija | | ----------- | -------------------------- | | vehicleid | ID vozila. | | componentid | ID komponente za ukloniti. | ## Returns 0 - Komponenta nije uklonjena jer vozilo ne postoji. 1 - Komponenta je uspješno uklonjena sa vozila. ## Primjeri ```c //ukloni Nitro sa vozila broj 1 RemoveVehicleComponent(1, 1010); ``` ## Srodne Funkcije - [AddVehicleComponent](AddVehicleComponent): Dodaje komponentu na vozilo. - [GetVehicleComponentInSlot](GetVehicleComponentInSlot): Provjeri koje komponente vozilo ima. - [GetVehicleComponentType](GetVehicleComponentType): Provjeri tip komponente preko ID-a. - [OnVehicleMod](../callbacks/OnVehicleMod): Pozvano kada vozilo biva nadograđeno. - [OnEnterExitModShop](../callbacks/OnEnterExitModShop): Pozvano kada vozilo uđe ili izađe iz mod shopa.
openmultiplayer/web/docs/translations/bs/scripting/functions/RemoveVehicleComponent.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/RemoveVehicleComponent.md", "repo_id": "openmultiplayer", "token_count": 413 }
348
--- title: SetActorInvulnerable description: Uključite/isključite aktorovu neranjivost. tags: [] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Uključite/isključite aktorovu neranjivost. | Ime | Deskripcija | | ------------ | ----------------------------------------------------- | | actorid | ID aktora za postaviti ranjivost. | | invulnerable | 0 da ga učinite ranjivim, 1 da ga učinite neranjivim. | ## Returns 1 - uspješno 0 - greška (Aktor nije kreiran). ## Primjeri ```c new gMyActor; public OnGameModeInit() { gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Aktor kao prodavač u Ammunation-u. SetActorInvulnerable(gMyActor, true); return 1; } ``` ## Zabilješke :::warning Jednom postavljen za neranjivog, aktor ne poziva OnPlayerGiveDamageActor. Igračima će se stanje aktorove neranjivosti promijeniti samo kad im se to ponovno učita. ::: ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/functions/SetActorInvulnerable.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetActorInvulnerable.md", "repo_id": "openmultiplayer", "token_count": 479 }
349
--- title: SetPVarFloat description: Postavi float vrijednost player (igračeve) varijable. tags: ["pvar"] --- ## Deskripcija Postavi float vrijednost player (igračeve) varijable. | Ime | Deskripcija | | ----------- | ---------------------------------------------------- | | playerid | ID igrača čija će player varijabla biti postavljena. | | varname | Ime player varijable. | | float_value | Float za pohraniti u player varijablu. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ili navedeni igrač nije konektovan, ili je ime varijable prazno ili preko 40 karaktera. ## Primjeri ```c forward SavePos(playerid); public SavePos(playerid) { new Float: x, Float: y, Float: z; GetPlayerPos(playerid, x, y, z); // Dobij poziciju igrača SetPVarFloat(playerid, "xpos", x); // Pohrani float u player varijablu SetPVarFloat(playerid, "ypos", y); // Pohrani float u player varijablu SetPVarFloat(playerid, "zpos", z); // Pohrani float u player varijablu return 1; } ``` ## Zabilješke :::tip Varijable se resetiraju tek nakon što se pozove OnPlayerDisconnect, tako da su vrijednosti i dalje dostupne u OnPlayerDisconnect. ::: ## Srodne Funkcije - [SetPVarInt](SetPVarInt): Postavi cijeli broj za igračevu varijablu. - [GetPVarInt](GetPVarInt): Dobij prethodno postavljeni cijeli broj iz igračeve varijable. - [SetPVarString](SetPVarString): Postavi string za igračevu varijablu. - [GetPVarString](GetPVarString): Dobij prethodno postavljeni string iz igračeve varijable. - [GetPVarFloat](GetPVarFloat): Dobij prethodno postavljeni float iz igračeve varijable. - [DeletePVar](DeletePVar): Ukloni igračevu varijablu.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPVarFloat.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPVarFloat.md", "repo_id": "openmultiplayer", "token_count": 786 }
350
--- title: SetPlayerHoldingObject description: Pričvršćuje objekat za kost. tags: ["player"] --- ## Deskripcija Pričvršćuje objekat za kost. | Ime | Deskripcija | | -------- | -------------------------------------------------------------- | | playerid | ID igrača za kojeg želite prikvačiti objekat. | | modelid | Model kojeg želite koristiti. | | bone | [Kost](../resources/boneid) za koju želite prikvačiti objekat. | | fOffsetX | (neobavezno) Pomak osi X za položaj objekta. | | fOffsetY | (neobavezno) Pomak osi Y za položaj objekta. | | fOffsetZ | (neobavezno) Pomak osi Z za položaj objekta. | | fRotX | (neobavezno) Pomak osi X za rotaciju objekta. | | fRotY | (neobavezno) Pomak osi Y za rotaciju objekta. | | fRotZ | (neobavezno) Pomak osi Z za rotaciju objekta. | ## Returns 1 pri uspjehu, 0 pri grešci. ## Primjeri ```c public OnPlayerSpawn(playerid) { SetPlayerHoldingObject(playerid, 1609, 2); // Prikvači kornjaču za playerid-evu glavu! return 1; } ``` ## Zabilješke :::tip Po igraču se može prikačiti samo jedan predmet. Ova je funkcija odvojena od spremišta CreateObject / CreatePlayerObject. ::: :::warning uklonjena je u SA-MP 0.3c. Provjeri [SetPlayerAttachedObject](SetPlayerAttachedObject) ::: ## Srodne Funkcije - [StopPlayerHoldingObject](StopPlayerHoldingObject): Uklanja prikvačene objekte.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerHoldingObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerHoldingObject.md", "repo_id": "openmultiplayer", "token_count": 791 }
351
--- title: SetPlayerSkillLevel description: Postavite nivo vještine određene vrste oružja za igrača. tags: ["player"] --- ## Deskripcija Postavite nivo vještine određene vrste oružja za igrača. | Ime | Deskripcija | | -------- | --------------------------------------------------------------------------------------------------------------- | | playerid | ID igrača za postaviti nivo vještine oružja. | | skill | [Oružje](../resources/weaponskills) za postaviti vještine. | | level | Razina vještine koju treba postaviti za to oružje, u rasponu od 0 do 999. Nivo izvan dosega maksimaliziraće ga. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerSpawn(playerid) { SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1); // To će natjerati igrača da koristi sawn-off sa jednom rukom. return 1; } ``` ## Zabilješke :::warning Parametar vještine NIJE ID oružja, to je vrsta vještine. Kliknite ovdje za listu vrsta vještina. ::: ## Srodne Funkcije - [SetPlayerArmedWeapon](SetPlayerArmedWeapon): Postavite igračevo "armed" oružje. - [GivePlayerWeapon](GivePlayerWeapon): Daj igraču oružje. ## Srodne Informacije - [Weapon Skills](../resources/weaponskills#skill-levels): Popis oružja koje se koriste za postavljanje nivoa vještine igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerSkillLevel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerSkillLevel.md", "repo_id": "openmultiplayer", "token_count": 780 }
352
--- title: SetTimerEx description: Postavlja tajmer za pozivanje funkcije nakon navedenog intervala. tags: [] --- ## Deskripcija Postavlja tajmer za pozivanje funkcije nakon navedenog intervala. Ova varijanta ('Ex') može proslijediti parametre (kao npr playerID) funkciji. | Ime | Deskripcija | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | funcname[] | Ime javne funkcije koju treba pozvati kada istekne tajmer. | | interval | Interval u milisekundama (1 sekunda = 1000 MS). | | repeating | Boolean (true/false (ili 1/0)) koji navodi treba li tajmer pozivati ​​više puta (može se zaustaviti samo pomoću KillTimer) ili samo jednom. | | format[] | Poseban format koji označava vrste vrijednosti koje će tajmer proći. | | {Float,\_}:... | Neograničeni broj argumenata koje treba proslijediti (mora slijediti format naveden u prethodnom parametru). | ## Returns ID tajmera koji je pokrenut. ID-ovi odbrojavanja počinju na 1 i nikad se više ne koriste. Ne postoje interne provjere koje bi provjerile jesu li proslijeđeni valjani parametri (npr. Trajanje nije minus vrijednost). Y_Less-ov 'fixes2' plugin implementira ove provjere i također značajno poboljšava preciznost tajmera, a također dodaje podršku za prolazak stringa/niza. ## Primjeri ```c SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid); // EndAntiSpawnKill - funkcija koja će biti pozvana // 5000 - 5000 MS (5 sekundi). Ovo je interval. Tajmer će se pozvati nakon 5 sekundi. // false - Ne ponavlja se. Pozvat će se samo jednom. // "i" - I označava cijeli broj (cijeli broj). Funkciji prenosimo cijeli broj (ID igrača). // playerid - Vrijednost koju treba proslijediti. Ovo je cijeli broj naveden u prethodnom parametru. // Povratni poziv događaja (OnPlayerSpawn) - ovdje ćemo pokrenuti tajmer public OnPlayerSpawn(playerid) { // Anti-Spawnkill (5 sekundi) // Postavi im veoma visoke helte tako da ne mogu biti ubijeni SetPlayerHealth(playerid, 999999); // Obavijesi ih SendClientMessage(playerid, -1, "Zasticen si od spawn-killa 5 sekundi."); // Započni tajmer od 5 sekundi koji će zaustaviti Anti-SpawnKill SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid); } // Forward (učini public) funkcijom kako bi je server mogao 'vidjeti' forward EndAntiSpawnKill(playerid); // Tajmer funkcija - kod koji treba izvršiti kada se pozove tajmer ide ovdje public EndAntiSpawnKill(playerid) { // 5 sekundi je prošlo, tako da mu stavljamo healthe nazad na 100 SetPlayerHealth(playerid, 100); // Opet ih obavijestimo SendClientMessage(playerid, -1, "Više nisi pod Spawn-kill zaštitom"); return 1; } ``` ## Zabilješke :::tip Varijable ID-a tajmera trebaju se inicijalizirati na -1 kada mogu kako bi se smanjila mogućnost slučajnog ubijanja ID-a tajmera 0 greškom (ili upotrijebite ID tajmera 0 gore na početku OnGameModeInit). Intervali tajmera nisu tačni (otprilike 25% popusta). Postoje ispravci dostupni ovdje i ovdje. Funkcija koju treba pozvati mora biti javna. To znači da se mora proslijediti. ::: ## Srodne Funkcije - [SetTimer](SetTimer): Postavi tajmer. - [KillTimer](KillTimer): Zaustavi tajmer. - [CallLocalFunction](CallLocalFunction): Pozovite funkciju u skripti. - [CallRemoteFunction](CallRemoteFunction): Pozovite funkciju u bilo kojoj učitanoj skripti.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetTimerEx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetTimerEx.md", "repo_id": "openmultiplayer", "token_count": 1789 }
353
--- title: ShowNameTags description: Omogući/onemogući iscrtavanje nametag-ova, healthbar-ova i armora iznad igrača. tags: [] --- ## Deskripcija Omogući/onemogući iscrtavanje nametag-ova, healthbar-ova i armora iznad igrača. | Ime | Deskripcija | | ------- | ------------------------------------------------------------------- | | enabled | 0 za onemogućiti, 1 za omogućiti (omogućeno po zadanim postavkama). | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnGameModeInit() { // Ovo će u potpunosti onemogućiti sve nametag-ove // (uključujući health i armour bar-ove) ShowNameTags(0); } ``` ## Zabilješke :::warning Ova funkcija se može koristiti samo u OnGameModeInit. Za ostala vremena, pogledajte ShowPlayerNameTagForPlayer. ::: ## Srodne Funkcije - [DisableNameTagLOS](DisableNameTagLOS): Onemogućite provjeru oznake imena. - [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): Prikaži ili sakrij nametag za određenog igrača. - [ShowPlayerMarkers](ShowPlayerMarkers): Odlučite hoće li server prikazivati ​​oznake na radaru.
openmultiplayer/web/docs/translations/bs/scripting/functions/ShowNameTags.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ShowNameTags.md", "repo_id": "openmultiplayer", "token_count": 522 }
354
--- title: TextDrawCreate description: Kreira textdraw. tags: ["textdraw"] --- ## Deskripcija Kreira textdraw. Textdraw-ovi su, kako samo ime implicira, tekst (uglavnom - ovdje također mogu biti boxovi, sprite-ovi i pregledi modela (skinovi/vozila/oružja/objekti) koji je iscrtan na igračevom zaslonu. Pogledaj ovu stranicu za opsežne informacije o textdraw-ovima. | Ime | Deskripcija | | ------- | --------------------------------------------------- | | Float:x | X (left/right) kordinata to create the textdraw at. | | Float:y | Y (up/down) kordinata to create the textdraw at. | | text[] | The text that will appear in the textdraw. | ## Returns ID kreiranog textdraw-a. Textdraw IDs start at 0. ## Primjeri ```c // ova varijabla je korištena za pohraniti ID textdrawa // kako bismo ga mogli koristiti kroz skriptu new Text:gMyTextdraw; public OnGameModeInit() { // Ova linija nam korisit kako bismo kreirali textdraw // Zabilješka: Ovo kreira textdraw bez ikakvog formatiranja. gMyTextdraw = TextDrawCreate(240.0,580.0,"Dobrodosli na moj SA-MP server"); return 1; } public OnPlayerConnect(playerid) { //Ovo je korišteno da prikaže textdraw igraču kada se konektuje. TextDrawShowForPlayer(playerid, gMyTextdraw); } ``` ## Zabilješke :::tip X, Y kordinata je gornja lijeva kordinata za područje textdrawa na osnovu 640x448 "platna" (bez obzira na razlučivost zaslona). Ako planirate koristiti TextDrawAlignment s poravnanjem 3 (desno), kordinata x, Y je gornja desna kordinata za crtanje teksta. Ova funkcija samo KREIRA izvlačenje teksta, za prikaz morate koristiti TextDrawShowForPlayer ili TextDrawShowForAll. Preporučuje se upotreba CIJELIH brojeva umjesto decimalnih mjesta prilikom kreiranja crteža teksta kako bi se osigurao dizajn prilagođen rezoluciji. ::: :::warning Kodovi preslikavanja tipki na tipkovnici (kao npr ~k~~VEHICLE_ENTER_EXIT~ ne rade preko 255-og karaktera. ::: ## Srodne Funkcije - [TextDrawDestroy](TextDrawDestroy): Uništi textdraw. - [TextDrawColor](TextDrawColor): Postavi boju teksta u textdrawu. - [TextDrawBoxColor](TextDrawBoxColor): Postavi boju boxa u textdrawu. - [TextDrawBackgroundColor](TextDrawBackgroundColor): Postavi boju pozadine textdrawa. - [TextDrawAlignment](TextDrawAlignment): Postavi poravnanje textdrawa. - [TextDrawFont](TextDrawFont): Postavi font textdrawa. - [TextDrawLetterSize](TextDrawLetterSize): Postavi veličinu znakova teksta u textdrawu. - [TextDrawTextSize](TextDrawTextSize): Postavi veličinu boxa u textdrawu. - [TextDrawSetOutline](TextDrawSetOutline): Odluči da li da tekst ima outline. - [TextDrawSetShadow](TextDrawSetShadow): Uključi/isključi sjene (shadows) na textdrawu. - [TextDrawSetProportional](TextDrawSetProportional): Razmjestite razmak između teksta u texstdrawu na proporcionalni omjer. - [TextDrawUseBox](TextDrawUseBox): Uključite ili isključite da li textdraw koristi box ili ne. - [TextDrawSetString](TextDrawSetString): Postavi tekst u već postojećem textdrawu. - [TextDrawShowForPlayer](TextDrawShowForPlayer): Prikaži textdraw za određenog igrača. - [TextDrawHideForPlayer](TextDrawHideForPlayer): Sakrij textdraw za određenog igrača. - [TextDrawShowForAll](TextDrawShowForAll): Prikaži textdraw za sve igrače. - [TextDrawHideForAll](TextDrawHideForAll): Sakrij textdraw za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawCreate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawCreate.md", "repo_id": "openmultiplayer", "token_count": 1357 }
355
--- title: TextDrawTextSize description: Promijeni veličinu textdrawa (veličinu boxa ako je TextDrawUseBox omogućen i/ili klikljivo područje za koristiti sa TextDrawSetSelectable). tags: ["textdraw"] --- ## Deskripcija Promijeni veličinu textdrawa (veličinu boxa ako je TextDrawUseBox omogućen i/ili klikljivo područje za koristiti sa TextDrawSetSelectable). | Ime | Deskripcija | | ------- | ----------------------------------------------------------------------------------- | | text | TextDraw za promijeniti veličinu. | | Float:x | Veličina na X osi (lijevo/desno) slijedeći istu mrežu 640x480 kao i TextDrawCreate. | | Float:y | Veličina na Y osi (gore/dole) slijedeći istu mrežu 640x480 kao i TextDrawCreate. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c new Text: gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(100.0, 33.0,"Primjer Textdrawa"); TextDrawTextSize(gMyTextdraw, 2.0, 3.6); return 1; } ``` ## Zabilješke :::tip X i y imaju različita značenja s različitim vrijednostima TextDrawAlignment: 1 (lijevo): krajnji su desni ugao boxa, apsolutna kordinatama. 2 (sredina): trebaju se okrenuti (prebaciti dva), a X vrijednost je ukupna širina boxa. 3 (desno): x i y su kordinate krajnjeg lijevog ugla boxa. Upotrebom tipa fonta 4 (sprite) i 5 (pregled modela) pretvara X i Y ove funkcije iz kordinata ugla u WIDTH i HEIGHT (offseti). Okvir TextDraw započinje 10.0 jedinica gore i 5.0 lijevo kao ishodište (TextDrawCreate kordinata). Ova funkcija definira područje na koje je moguće kliknuti za upotrebu s TextDrawSetSelectable, bilo da je box prikazan ili ne. ::: :::tip Ako želite promijeniti veličinu teksta textdrawa koji je već prikazan, ne morate ga ponovno kreirati. Prosto koristite TextDrawShowForPlayer/TextDrawShowForAll nakon uređivanja i promjena će biti vidljiva. ::: ## Srodne Funkcije - [TextDrawCreate](TextDrawCreate): Kreiraj textdraw. - [TextDrawDestroy](TextDrawDestroy): Uništi textdraw. - [TextDrawColor](TextDrawColor): Postavi boju teksta u textdrawu. - [TextDrawBoxColor](TextDrawBoxColor): Postavi boju boxa u textdrawu. - [TextDrawBackgroundColor](TextDrawBackgroundColor): Postavi boju pozadine textdrawa. - [TextDrawAlignment](TextDrawAlignment): Postavi poravnanje textdrawa. - [TextDrawFont](TextDrawFont): Postavi font textdrawa. - [TextDrawLetterSize](TextDrawLetterSize): Postavi veličinu znakova teksta u textdrawu. - [TextDrawSetOutline](TextDrawSetOutline): Odluči da li da tekst ima outline. - [TextDrawSetShadow](TextDrawSetShadow): Uključi/isključi sjene (shadows) na textdrawu. - [TextDrawSetProportional](TextDrawSetProportional): Razmjestite razmak između teksta u texstdrawu na proporcionalni omjer. - [TextDrawUseBox](TextDrawUseBox): Uključite ili isključite da li textdraw koristi box ili ne. - [TextDrawSetString](TextDrawSetString): Postavi tekst u već postojećem textdrawu. - [TextDrawShowForPlayer](TextDrawShowForPlayer): Prikaži textdraw za određenog igrača. - [TextDrawHideForPlayer](TextDrawHideForPlayer): Sakrij textdraw za određenog igrača. - [TextDrawShowForAll](TextDrawShowForAll): Prikaži textdraw za sve igrače. - [TextDrawHideForAll](TextDrawHideForAll): Sakrij textdraw za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawTextSize.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawTextSize.md", "repo_id": "openmultiplayer", "token_count": 1423 }
356
--- title: clamp description: Forsira vrijednost da bude unutar raspona. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Forsira vrijednost da bude unutar raspona. | Ime | Deskripcija | | ----- | ------------------------------ | | value | Vrijednost koja se forsira | | min | Donja granica raspona | | max | Visoka granica raspona | ## Returns Vrijednost, ukoliko se nalazi u rasponu min-max, min, ako je vrijednost manja od min ili max, ako je vrijednost veća od max. ## Primjeri ```c new valueA = 3, valueB = 7, valueC = 100 ; printf("Vrijednost: %d", clamp(valueA, 5, 10)); // ispis: "Vrijednost je: 5" zato što je 3 manje od 5 printf("Vrijednost: %d", clamp(valueB, 5, 10)); // ispis: "Vrijednost je: 7" zato što je 7 između 5 i 10 printf("Vrijednost: %d", clamp(valueC, 5, 10)); // ispis: "Vrijednost je: 10" zato što je 100 veće od 10 ``` ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/functions/clamp.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/clamp.md", "repo_id": "openmultiplayer", "token_count": 462 }
357
--- title: floatdiv description: Divide one float by another one. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Divide one float by another one. Redundant as the division operator (/) does the same thing. | Ime | Deskripcija | | -------------- | ----------------------------------------- | | Float:dividend | First float. | | Float:divisor | Second float (dividates the first float.) | ## Returns The quotient of the two given floats. ## Primjeri ```c public OnGameModeInit() { new Float:Number1 = 8.05, Float:Number2 = 3.5; //Declares two floats, Number1 (8.05) and Number2 (3.5) new Float:Quotient; Quotient = floatdiv(Number1, Number2); //Saves the quotient(=8.05/3.5 = 2.3) of Number1 and Number2 in the float "Quotient" return 1; } ``` ## Srodne Funkcije - [floatadd](floatadd): Dodaje dva floata zajedno. - [floatsub](floatsub): Oduzmi jedan float od drugog. - [floatmul](floatmul): Pomnožite dva floata.
openmultiplayer/web/docs/translations/bs/scripting/functions/floatdiv.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/floatdiv.md", "repo_id": "openmultiplayer", "token_count": 436 }
358
--- title: fremove description: Obriši datoteku. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Obriši datoteku. | Ime | Deskripcija | | ------ | --------------------------------------------------------------------- | | name[] | Path do datoteke koju želite izbrisati. (NOTE: Ne upravljač datoteke) | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Datoteka ne postoji ili nemate dozvolu da je izbrišete. ## Primjeri ```c fremove("Example.txt"); ``` ## Zabilješke :::tip Datoteke koje su trenutno otvorene (fopen) moraju se prvo zatvoriti (fclose) da bi se izbrisale. ::: :::warning Path do datoteke mora biti valjana. ::: ## Srodne Funkcije - [fopen](fopen): Otvori fajl/datoteku. - [fclose](fclose): Zatvori fajl/datoteku. - [ftemp](ftemp): Stvorite privremeni tok fajlova/datoteka. - [fremove](fremove): Uklonite fajl/datoteku. - [fwrite](fwrite): Piši u fajl/datoteku. - [fread](fread): Čitaj fajl/datoteku. - [fputchar](fputchar): Stavite znak u fajl/datoteku. - [fgetchar](fgetchar): Dobijte znak iz fajla/datoteke. - [fblockwrite](fblockwrite): Zapišite blokove podataka u fajl/datoteku. - [fblockread](fblockread): Očitavanje blokova podataka iz fajla/datoteke. - [fseek](fseek): Skoči na određeni znak u fajlu/datoteci. - [flength](flength): Nabavite dužinu fajla/datoteke. - [fexist](fexist): Provjeri da li datoteka postoji. - [fmatch](fmatch): Provjeri podudaraju li se uzorci s nazivom datoteke.
openmultiplayer/web/docs/translations/bs/scripting/functions/fremove.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/fremove.md", "repo_id": "openmultiplayer", "token_count": 722 }
359
--- title: min description: . tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Function used to compare the values. | Ime | Deskripcija | | --- | -------------------------- | | a | Vrijednost a za uporediti. | | b | Vrijednost b za uporediti. | ## Returns Returna/vraća najmanji od a i b. Ako su oba ekvivalentna, vraća se a. ## Primjeri ```c //S obzirom da je a manje od b rezultat će biti 5. public OnGameModeInit() { new a, b, rezultat; a = 5; b = 10; rezultat = min(a,b); printf ("min(a,b) =", param, rezultat); return 0; } ``` ## Srodne Funkcije - [min](min): Uporedite i dobiti minimalnu vrijednost. - [max](max): Uporedite i dobiti maksimalnu vrijednost.
openmultiplayer/web/docs/translations/bs/scripting/functions/min.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/min.md", "repo_id": "openmultiplayer", "token_count": 363 }
360
--- title: strpack description: Upakuj string. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Upakuj string. Upakovani stringovi koriste 75% manje memorije. | Ime | Deskripcija | | ----------------------- | ----------------------------------------------------------------------- | | dest[] | Odredišni string za sačuvati upakovani string, proslijeđeno referencom. | | const source[] | Izvor, originalni string. | | maxlength=sizeof string | Maksimalna veličina za unijeti. | ## Returns Broj upakovanih karaktera. ## Primjeri ```c new string[32 char]; strpack(string, "Cao, kako si?"); ``` ## Srodne Funkcije - [strcmp](strcmp): Uporedi dva stringa kako bi provjerio da li su isti. - [strfind](strfind): Pretraži string u drugom stringu. - [strins](../function/strins): Unesi tekst u string. - [strlen](../function/strlen): Dobij dužinu stringa. - [strmid](strmid): Izdvoji dio stringa u drugi string. - [strval](strval): Pretvori string u cijeli broj. - [strcat](strcat): Spojite dva stringa u odredišnu referencu. - [strdel](strdel): Obriši dio stringa.
openmultiplayer/web/docs/translations/bs/scripting/functions/strpack.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/strpack.md", "repo_id": "openmultiplayer", "token_count": 600 }
361
--- title: OnFilterScriptInit description: Wird ausgeführt wenn ein Filterscript gestartet wird (initialize). tags: [] --- ## Beschreibung Wird ausgeführt wenn ein Filterscript gestartet wird (initialize). Wird nur im entsprechenden Filterscript ausgeführt. ## Beispiele ```c public OnFilterScriptInit() { print("\n--------------------------------------"); print("The filterscript is loaded."); print("--------------------------------------\n"); return 1; } ``` ## Ähnliche Callbacks - [OnFilterSciptExit](OnFilterScriptExit): Wird ausgeführt wenn ein Filterscript deaktiviert wird. - [OnGameModeInit](OnGameModeInit): Wird ausgeführt wenn ein Gamemode gestartet wird. - [OnGameModeExit](OnGameModeExit): Wird ausgeführt wenn ein Gamemode beendet wird.
openmultiplayer/web/docs/translations/de/scripting/callbacks/OnFilterScriptInit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/de/scripting/callbacks/OnFilterScriptInit.md", "repo_id": "openmultiplayer", "token_count": 289 }
362
--- título: OnClientMessage descripción: Este callback se llama cuando el NPC ve un ClientMessage. tags: [NPC, ClientMessage, SendClientMessageToAll, ] --- ## Descripción Este callback se llama cuando el NPC ve un ClientMessage. Esto va a ser cada vez que la función SendClientMessageToAll sea usada o también cuando la función SendClientMessage sea enviada hacia un NPC. Este callback no va a ser llamado cuando un jugador envíe un mensaje. Para una version de esto con textos de jugadores, vea NPC:OnPlayerText. | Nombre | Descripción | | ------ | ------------------------------- | | color | El color del mensaje. | | text[] | El texto del mensaje. | ## Devoluciones Este callback no controla devoluciones. ## Ejemplos ```c public OnClientMessage(color, text[]) { if (strfind(text,"Balance Bancario: $0") != -1) { SendClientMessage(playerid, -1, "Soy pobre :("); } } ``` ## Funciones Relacionadas
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnClientMessage.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnClientMessage.md", "repo_id": "openmultiplayer", "token_count": 381 }
363
--- título: OnPlayerDeath descripción: Este callback se llama cuando un jugador muere, ya sea suicidándose o siendo asesinado por otro jugador. tags: ["player"] --- ## Descripción Este callback se llama cuando un jugador muere, ya sea suicidándose o siendo asesinado por otro jugador. | Nombre | Descripción | |---------------|-----------------------------------------------------------------------------------------| | playerid | El ID del jugador que murió. | | killerid | El ID del jugador que mató al jugador que murió, o INVALID_PLAYER_ID si no fue ninguno. | | WEAPON:reason | El ID de la causa de la muerte del jugador. | ## Devoluciones 1 - Prevendrá a otros filterscripts de recibir este callback. 0 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. ## Ejemplos ```c new PlayerDeaths[MAX_PLAYERS]; new PlayerKills[MAX_PLAYERS]; public OnPlayerDeath(playerid, killerid, WEAPON:reason) { SendDeathMessage(killerid, playerid, reason); //Muestra el asesinato en la tabla de asesinatos //Comprueba si 'killerid' es válida antes de hacer cualquier cosa con ella. if (killerid != INVALID_PLAYER_ID) { PlayerKills[killerid] ++; } //Fuera de la comprobación, hacer cosas sobre playerid (siempre es válido) PlayerDeaths[playerid] ++; return 1; } ``` ## Notas :::tip La razón retornará 37 (lanzallamas) por cualquier origen de fuego (ej. molotov, 18). La razón retornará 51 de cualquier arma que cree una explosión (ej. Lanzamisiles, granada). No es necesario comprobar si killerid es válido antes de usarlo en SendDeathMessage, ya que INVALID_PLAYER_ID es un parámetro válido en esa función. playerid es el único que puede llamar el callback. (bueno saberlo para anti fake death) ::: :::warning TENÉS que comprobar que 'killerid' sea válido (no INVALID_PLAYER-ID) antes de usarlo en un array (o realmente en donde sea), ya que causará que el script OnPlayerDeath crashee (no el script entero). Esto es debido a que INVALID_PLAYER_ID es definido como 65535, y si un array sólo tiene 'MAX_PLAYERS' elementos, ejemplo 500, vas a estar intentando acceder a un índice por arriba de 499, que está fuera de alcance (out of bonds). ::: ## Funciones Relacionadas - [SendDeathMessage](../functions/SendDeathMessage): Añadir un asesinato a la lista de muertes. - [SetPlayerHealth](../functions/SetPlayerHealth): Establecer la salud (vida) de un jugador.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerDeath.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerDeath.md", "repo_id": "openmultiplayer", "token_count": 1097 }
364
--- título: OnPlayerObjectMoved descripción: Este callback se llama cuando un objeto de jugador es movido después de MovePlayerObject (cuando este termina de moverse). tags: ["player"] --- ## Descripción Este callback se llama cuando un objeto de jugador es movido después de MovePlayerObject (cuando este termina de moverse). | Nombre | Descripción | | -------- | ------------------------------------------- | | playerid | El playerid al que está asignado el objeto. | | objectid | El ID del objeto de jugador que fue movido. | ## Devoluciones Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnPlayerObjectMoved(playerid, objectid) { printf("Objeto de jugador movido: ID de objeto: %d ID del jugador: %d", objectid, playerid); return 1; } ``` ## Notas :::tip Este callback también puede llamarse por NPC. ::: ## Funciones Relacionadas - [MovePlayerObject](../functions/MovePlayerObject): Mover un objeto de jugador. - [IsPlayerObjectMoving](../functions/IsPlayerObjectMoving): Comprobar si el objeto de jugador está moviéndose. - [StopPlayerObject](../functions/StopPlayerObject): Detener el movimiento de un objeto de jugador. - [CreatePlayerObject](../functions/CreatePlayerObject): Crear un objeto para un solo jugador. - [DestroyPlayerObject](../functions/DestroyPlayerObject): Destruir un objeto de jugador.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerObjectMoved.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerObjectMoved.md", "repo_id": "openmultiplayer", "token_count": 479 }
365
--- título: OnRconLoginAttempt descripción: Este callback se llama cuando alguien intenta identificarse como RCON adentro del juego, sin importar si tiene éxito o no. tags: [] --- ## Descripción Este callback se llama cuando alguien intenta identificarse como RCON adentro del juego, sin importar si tiene éxito o no. | Nombre | Descripción | | ---------- | ------------------------------------------------------- | | ip[] | La IP del jugador que intenta identificarse como RCON. | | password[] | La contraseña que fue usada para intentar logearse. | | success | 0 si la contraseña fue incorrecta o 1 si fue correcta. | ## Devoluciones Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnRconLoginAttempt(ip[], password[], success) { if (!success) //Si la contraseña fue incorrecta { printf("RCON LOGIN FALLIDO POR IP %s USANDO LA CONTRASEÑA %s",ip, password); new pip[16]; for(new i = GetPlayerPoolSize(); i != -1; --i) //Bucle a través de todos los jugadores { GetPlayerIp(i, pip, sizeof(pip)); if (!strcmp(ip, pip, true)) //Si la IP de un jugador es la IP que falló el inicio de sesión { SendClientMessage(i, 0xFFFFFFFF, "Contraseña equivocada. Chau!"); //Envía un mensaje Kick(i); //Kickea al jugador. } } } return 1; } ``` ## Notas :::tip Este callback se llama solo cuando /rcon login se usa adentro del juego. Este callback solo se llama cuando el jugador no está logeado aún. Cuando el jugador está logeado (como RCON obviamente), OnRconCommand es llamado en su lugar. ::: ## Funciones Relacionadas - [IsPlayerAdmin](../functions/IsPlayerAdmin): Comprueba si un jugador está identificado como RCON. - [SendRconCommand](../functions/SendRconCommand): Envía un comando RCON desde el script.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnRconLoginAttempt.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnRconLoginAttempt.md", "repo_id": "openmultiplayer", "token_count": 808 }
366
--- title: Guía de Pickup --- Un breve tutorial que describe cómo usar pickups. ## Definir el pickup Lo primero que se debe hacer al crear pickup es crear su identificación. Esto se hará en una variable global. Para este ejemplo usaremos el nombre "gMiPickup". ```c new gMiPickup; ``` ## Creando la pickup Hay dos formas de crear pickup [CreatePickup](../scripting/functions/CreatePickup) y [AddStaticPickup](../scripting/functions/AddStaticPickup). AddStaticPickup no hay un id cuando esta creado, no se puede destruir y no mas puede usar en OnGameModeInit, para este guía vamos a usar [CreatePickup](../scripting/functions/CreatePickup). **La forma de [CreatePickup](../scripting/functions/CreatePickup) es:** **Parameters:** | modelo | El modelo que queres usar | | ------------ | --------------------------------------------------------------------------------------------------------- | | typo | El typo de pickup que es utiliza | | Float:X | La X-coordenada para el pickup. | | Float:Y | La Y-coordinate para el pickup. | | Float:Z | La Z-coordinate para el pickup. | | Virtualworld | El mundo virtual de la pickup. La mundo virtual de -1 se va a ensenar para todos los mundos virtruales. | Para este ejemplo, crearemos un pickup en Grove Street. Ahora debemos decidir qué modelo aparecerá en el mundo, hay muchos modelos para elegir, algunos se enumeran en el sitio externo [aquí] (https://dev.prineside.com/en/gtasa_samp_model_id), aquí elija el número de modelo 1274, que es el signo de dólar. Finalmente, necesitamos un [Tipo] (../scripting/resources/pickuptypes) para la pickup, en la misma página con los modelos de pickup hay una lista de tipos de pickup que describen lo que hacen los typos. Queremos que esta recolección desaparezca cuando la levante, para que no pueda levantarla repetidamente, pero que vuelva a aparecer después de unos minutos para que pueda levantarla nuevamente, el typo 2 hace exactamente esto. Las pickups se crean más comúnmente cuando se inicia el script, en [OnGameModeInit](../scripting/callbacks/OnGameModeInit) o en [OnFilterScriptInit](../scripting/callbacks/OnFilterScriptInit) dependiendo del tipo de la script, también se puede ir en cualquier función (por ejemplo, podría crear un script de deja los armas del jugardor, eso se usaría OnPlayerDeath para crear pickup de armas). Aquí hacemos la pickup en la variable 'gMiPickup': ```c gMiPickup = CreatePickup(1274, 2, 2491.7900, -1668.1653, 13.3438, -1); ``` Cuando recoges una pickup, se llama la función [OnPlayerPickUpPickup](../scripting/callbacks/OnPlayerPickUpPickup), pasando playerid (el jugador que recogió la pickup) y pickupid (la ID de la pickup que se recogió). Algunos typos de pickup están diseñados para funcionar automáticamente, por lo que no es necesario hacer nada en OnPlayerPickUpPickup. Consulte la página [Typos de pickup](../scripting/resources/pickuptypes) para obtener más información. Cuando un jugador recoge nuestra nueva pickup, queremos darle $100, para hacer esto primero debemos verificar que haya recogido nuestra pickup de dólares y no una diferente. Cuando hayamos hecho eso, podemos darles los $100: ```c public OnPlayerPickUpPickup(playerid, pickupid) { // Checka que el jugador esta en la correcta pickup if(pickupid == gMiPickup) { // Mensaje a al jugador SendClientMessage(playerid, 0xFFFFFFFF, "You received $100!"); // Darle dinero GivePlayerMoney(playerid, 100); } return 1; } ``` ¡Felicidades, ahora sabe cómo crear y manejar pickups!
openmultiplayer/web/docs/translations/es/tutorials/PickupGuide.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/tutorials/PickupGuide.md", "repo_id": "openmultiplayer", "token_count": 1642 }
367
--- title: سبک های دیالوگ --- <div dir="rtl" style={{ textAlign: "right" }}> :::note نکته - در [OnDialogResponse](../callbacks/OnDialogResponse) فشردن **button1** باعث میشود **response** **1** باشد، اگر **button2** فشرده شود باعث میشود **response** **0** شود. - هر دیالوگ میتواند دو دکمه داشته باشید. برای اینکه دکمه نشان داده نشود آن را خالی بگذارید، مثل مثال اول. پلیر ها قادر نخواهند بود بر روی آن دکمه کلیک کنند اما آن ها قادر خواند بود با فشردن دکمه ESC [OnDialogResponse](../callbacks/OnDialogResponse) را با **response** = **0** فرا بخوانند. - [ShowPlayerDialog](../functions/ShowPlayerDialog): روش color-embedding میتواند برای هر string استفاده شود : **caption**, **info**, **button1** و **button2**. ::: - این صفحه [ShowPlayerDialog](../functions/ShowPlayerDialog) و [OnDialogResponse](../callbacks/OnDialogResponse) را توضیح میدهد. - برای دیدن محدود ها صفحه [Limits](../resources/limits) را ببینید. - برای مثال واکنش بازیکن به دیالوگ، میتوانید از این کد ها استفاده کنید : </div> ```c public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] ) { printf( "playerid = %d, dialogid = YOUR_DIALOGID, response = %d, listitem = %d, inputtext = '%s' (size: %d)", playerid, response, listitem, inputtext, strlen( inputtext ) ); return 1; } ``` <div dir="rtl" style={{ textAlign: "right" }}> ## سبک 0: `DIALOG_STYLE_MSGBOX` ![](/images/dialogStyles/Dialog_style_msgbox.png) نمایش دادن: :::note نکته - **\t** مقداری فاصله ایجاد میکند. - **\n** یک خط جدید میسازد. - روش Color-Embedding بعد از \n \t ریست نمیشود و رنگ آن عوض نمیشود. ::: </div> ```c ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_MSGBOX, "Caption", "Info\n\tInfo", "Button 1", ""); ``` <div dir="rtl" style={{ textAlign: "right" }}> ### پاسخ خروجی :::note نکته - **listitem** همیشه **-1** است. - **inputtext** همیشه خالی است. ::: </div> ```c // Dokme feshorde shod playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = -1, inputtext = '' (size: 0) // Dokme ESC feshore shod playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = '' (size: 0) ``` <div dir="rtl" style={{ textAlign: "right" }}> ## سبک 1: `DIALOG_STYLE_INPUT` ![](/images/dialogStyles/Dialog_style_input.png) نمایش دادن: :::note نکته - **\t** مقداری فاصله ایجاد میکند. - **\n** یک خط جدید میسازد. - روش Color-Embedding بعد از \n \t ریست نمیشود و رنگ آن عوض نمیشود. ::: </div> ```c ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_INPUT, "Caption", "Enter information below:", "Button 1", "Button 2"); ``` <div dir="rtl" style={{ textAlign: "right" }}> ### پاسخ خروجی :::note - **listitem** همیشه **-1** است. - **inputtext** توسط کاربر نوشته شده، شامل رنگ هم میشود. ::: </div> ```c // wrote "input" and pressed the left button playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = -1, inputtext = 'input' (size: 5) // wrote "input" and pressed the right button playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = 'input' (size: 5) ``` <div dir="rtl" style={{ textAlign: "right" }}> ## سبک 2: `DIALOG_STYLE_LIST` ![](/images/dialogStyles/Dialog_style_list.png) نمایش دادن: :::note - **\t** مقداری فاصله ایجاد میکند. - **\n** یک خط جدید میسازد. - روش Color-Embedding بعد از \n \t ریست نمیشود و رنگ آن عوض نمیشود. ::: </div> ```c ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_LIST, "Caption", "Item 0\n{FFFF00}Item 1\nItem 2", "Button 1", "Button 2"); ``` <div dir="rtl" style={{ textAlign: "right" }}> ### پاسخ خروجی: :::note - **listitem**شماره مورد انتخاب شده است. از **0** شروع میشود. - **inputtext** متن مورد انتخاب شده، شامل رنگ ها نمیشود. ::: </div> ```c // selected the first list item and pressed the left button playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = 0, inputtext = 'Item 0' (size: 6) // selected the second list item and pressed the right button playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = 'Item 1' (size: 6) ``` <div dir="rtl" style={{ textAlign: "right" }}> ## سبک 3: `DIALOG_STYLE_PASSWORD` :::note نکته - شبیه **DIALOG_STYLE_INPUT**. ::: ![](/images/dialogStyles/Dialog_style_password.png) نمایش دادن: :::note نکته - **\t** مقداری فاصله ایجاد میکند. - **\n** یک خط جدید میسازد. ::: </div> ```c ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_PASSWORD, "Caption", "Enter private information below:", "Button 1", "Button 2"); ``` <div dir="rtl" style={{ textAlign: "right" }}> ### پاسخ خروجی :::note نکته - **listitem** همیشه **-1** است. - **inputtext** متن مورد انتخاب شده، شامل رنگ ها نمیشود. ::: </div> ```c // wrote "input" and pressed the left button playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = -1, inputtext = 'input' (size: 5) // wrote "input" and pressed the right button playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = -1, inputtext = 'input' (size: 5) ``` <div dir="rtl" style={{ textAlign: "right" }}> ## سبک 4: `DIALOG_STYLE_TABLIST` :::tip این مورد در نسخه **SA-MP 0.3.7** اضافه شده و در نسخه های قبلی کار نخواهد کرد! ::: :::note نکته - شبیه **DIALOG_STYLE_LIST**. ::: ![](/images/dialogStyles/Dialog_style_tablist.png) نمایش دادن: :::note نکته - **\t** مقداری فاصله ایجاد میکند. - **\n** یک خط جدید میسازد. - روش Color-Embedding بعد از \n یا \t ریست میشود. اولین خط **info** شامل سر تیتر میشود. ::: </div> ```c ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_TABLIST, "Caption", "Deagle\t$5000\t100\n\ {FF0000}Sawnoff\t{33AA33}$5000\t100\n\ Pistol\t$1000\t50", "Button 1", "Button 2"); ``` <div dir="rtl" style={{ textAlign: "right" }}> :::note نکته - **inputtext** متن اولین ستون از **listitem** انتخاب شده، بدون رنگ ها. ::: </div> ```c // selected the first list item and pressed the left button playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = 0, inputtext = 'Deagle' (size: 6) // selected the second list item and pressed the right button playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = 'Sawnoff' (size: 7) ``` <div dir="rtl" style={{ textAlign: "right" }}> ## سبک 5: `DIALOG_STYLE_TABLIST_HEADERS` :::tip این مورد در نسخه **SA-MP 0.3.7** اضافه شده و در نسخه های قبلی کار نخواهد کرد! ::: :::note نکته - شبیه**DIALOG_STYLE_LIST**. ::: ![](/images/dialogStyles/Dialog_style_tablist_headers.png) نمایش دادن: :::note نکته - **\t** مقداری فاصله ایجاد میکند. - **\n** یک خط جدید میسازد. - روش Color-Embedding بعد از \n یا \t ریست میشود. اولین خط **info** شامل سر تیتر میشود. ::: </div> ```c ShowPlayerDialog(playerid, YOUR_DIALOGID, DIALOG_STYLE_TABLIST_HEADERS, "Caption", "Header 1\tHeader 2\tHeader 3\n\ Item 1 Column 1\tItem 1 Column 2\tItem 1 Column 3\n\ {FF0000}Item 2 Column 1\t{33AA33}Item 2 Column 2\tItem 2 Column 3", "Button 1", "Button 2"); ``` <div dir="rtl" style={{ textAlign: "right" }}> :::note نکته - **inputtext** متن اولین ستون از **listitem** انتخاب شده، بدون رنگ ها. ::: </div> ```c // selected the first list item and pressed the left button playerid = 0, dialogid = YOUR_DIALOGID, response = 1, listitem = 0, inputtext = 'Item 1 Column 1' (size: 15) // selected the first list item and pressed the right button playerid = 0, dialogid = YOUR_DIALOGID, response = 0, listitem = 1, inputtext = 'Item 2 Column 1' (size: 15) ```
openmultiplayer/web/docs/translations/fa/scripting/resources/dialogstyles.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fa/scripting/resources/dialogstyles.md", "repo_id": "openmultiplayer", "token_count": 4206 }
368
--- title: OnGameModeExit description: This callback is called when a gamemode ends, either through 'gmx', the server being shut down, or GameModeExit. tags: [] --- ## Description Ang callback na ito ay itinatawag kapag ang isang gamemode ay isinara or itinapos. Itinatawag ito tuwing itinatawag ang rcon command na `gmx`, o kapag and server ay ishinu-shutdown, o GameModeExit. ## Examples ```c public OnGameModeExit() { print("Ang gamemode ay isinara."); return 1; } ``` ## Mga Dapat Unawain :::tip Ang function na ito ay pwede rin gamitin sa mga filterscript, upang idetect kung ang gamemode ay nabago gamit ang RCON commands katulad ng changemode o gmx, sapagkat ang pagpapalit ng gamemode ay hindi nagrereload ng filterscript. Kapag ginagamit ang OnGameModeExit kasabay ang 'rcon gmx' na command sa console, tandaan na pwede ito magdulot ng client bugs tulad ng sobra sobra na pagtawag ng RemoveBuildingForPlayer tuwing OnGameModeInit na pwede magdulot ng crash sa client. Ang callback na ito ay hindi tatawagin kapag ang server ay nag crash or napatay gamit ang ibang bagay, tulad ng Linux kill command o ang pag pindot ng close-button sa console ng Windows. ::: ## Mga Kaugnay na Functions - [GameModeExit](../functions/GameModeExit.md): Isinasara ang gamemode.
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnGameModeExit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnGameModeExit.md", "repo_id": "openmultiplayer", "token_count": 438 }
369
--- title: OnPlayerConnect description: This callback is called when a player connects to the server. tags: ["player"] --- ## Description Ang callback na ito ay itinatawag kapag ang isang player ay kumonek sa server. | Name | Description | | -------- | -------------------------------------- | | playerid | Ang ID ng player na kumonek sa server. | ## Returns 0 - Ay papagbawalan ang ibang filterscript na tanggapin itong callback. 1 - Ay nagpapahiwatig na ang callback na ito ay ipapasa sa susunod na filterscript. Ito ay palaging unang tinatawag sa mga filterscript. ## Examples ```c public OnPlayerConnect(playerid) { new string[64], playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); format(string, sizeof string, "%s ay pumasok sa server, mabuhay!", playerName); SendClientMessageToAll(0xFFFFFFAA, string); return 1; } ``` ## Notes <TipNPCCallbacks /> ## Related Functions
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerConnect.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerConnect.md", "repo_id": "openmultiplayer", "token_count": 356 }
370
--- title: AddSimpleModel description: Nagdaragdag ng bagong custom na simpleng object model para sa pag-download. tags: [] --- <VersionWarn version='SA-MP 0.3.DL R1' /> ## Description Nagdaragdag ng bagong custom na simpleng object model para sa pag-download. Ang mga file ng modelo ay maiimbak sa Documents\GTA San Andreas User Files\SAMP\cache ng player sa ilalim ng Server IP at Port folder sa isang CRC-form file name. | Name | Description | | ------------ | --------------------------------------------------------------------------------------------------------------------------- | | virtualworld | Ang virtual world ID para gawing available ang modelo sa. Gamitin ang -1 para sa lahat ng mundo. | | baseid | Ang batayang object model ID na gagamitin (orihinal na object na gagamitin kapag nabigo ang pag-download). | | newid | Ang bagong object model ID ay mula -1000 hanggang -30000 (29000 slots) na gagamitin sa ibang pagkakataon kasama ang CreateObject o CreatePlayerObject.| | dffname | Pangalan ng .dff model collision file na matatagpuan sa folder ng server ng mga modelo bilang default (setting ng artpath) | | txdname | Pangalan ng .txd model texture file na matatagpuan sa folder ng server ng mga modelo bilang default (setting ng artpath). | ## Returns 1: Matagumpay na naisakatuparan ang function. 0: Nabigo ang function na isagawa. ## Examples ```c public OnGameModeInit() { AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); return 1; } ``` ```c AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); ``` ## Notes :::tip Ang `useartwork` ay dapat munang paganahin sa mga setting ng server upang ito ay gumana Kapag ang virtualworld ay nakatakda, ang mga modelo ay mada-download kapag ang manlalaro ay pumasok sa partikular na mundo ::: :::warning Kasalukuyang walang mga paghihigpit sa kung kailan mo maaaring tawagan ang function na ito, ngunit magkaroon ng kamalayan na kung hindi mo sila tatawagan sa loob ng OnFilterScriptInit/OnGameModeInit, magkakaroon ka ng panganib na ang ilang mga manlalaro, na nasa server na, ay maaaring hindi na-download ang mga modelo. ::: ## Related Functions - [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): Tinatawag kapag natapos na ng player ang pag-download ng mga custom na modelo.
openmultiplayer/web/docs/translations/fil/scripting/functions/AddSimpleModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/AddSimpleModel.md", "repo_id": "openmultiplayer", "token_count": 940 }
371
--- title: Ban description: I-ban ang isang manlalaro na kasalukuyang nasa server. tags: ["administration"] --- ## Description I-ban ang isang manlalaro na kasalukuyang nasa server. Hindi na sila makakasali muli sa server. Ang pagbabawal ay magiging IP-based, at mase-save sa samp.ban file sa root directory ng server. Maaaring gamitin ang BanEx upang magbigay ng dahilan para sa pagbabawal. Maaaring idagdag/alisin ang mga IP ban gamit ang RCON banip at unbanip command (SendRconCommand). | Name | Description | | -------- | ---------------------------- | | playerid | Ang ID ng player na ipagbawal.| ## Returns Ang function na ito ay hindi nagbabalik ng anumang partikular na halaga. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/banme", true) == 0) { // I-ban ang player kung sino ang nagsulat ng command na ito Ban(playerid); return 1; } } // Upang magpakita ng mensahe (hal. dahilan) para sa player bago isara ang koneksyon // kailangan mong gumamit ng timer para gumawa ng pagkaantala. Ang pagkaantala na ito ay kailangan lang ng ilang millisecond ang haba, // ngunit ang halimbawang ito ay gumagamit ng isang buong segundo para lamang maging ligtas. forward DelayedBan(playerid); public DelayedBan(playerid) { Ban(playerid); } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/banme", true) == 0) { // I-ban ang manlalaro kung sino ang gumamit ng command na ito. // Una, bigyan mo sila ng mensahe. SendClientMessage(playerid, 0xFF0000FF, "You have been banned!"); // I-ban na ang manlalaro sa susunod na segundo. SetTimerEx("DelayedBan", 1000, false, "d", playerid); return 1; } return 0; } ``` ## Notes :::warning Ang anumang aksyon na direktang ginawa bago ang Ban() (tulad ng pagpapadala ng mensahe gamit ang SendClientMessage) ay hindi makakarating sa player. Dapat gumamit ng timer para maantala ang pagbabawal. ::: ## Related Functions - [BanEx](BanEx): I-ban ang isang manlalaro na may dahilan. - [Kick](Kick): I-kick ang isang manlalaro mula sa server.
openmultiplayer/web/docs/translations/fil/scripting/functions/Ban.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/Ban.md", "repo_id": "openmultiplayer", "token_count": 845 }
372
--- title: ResumeRecordingPlayback description: Ipagpapatuloy nito ang naka-pause na pag-record. tags: [] --- ## Description Ipagpapatuloy nito ang naka-pause na pag-record. ## Related Functions - [PauseRecordingPlayback](../functions/PauseRecordingPlayback): Ipagpapatuloy ang pagre-record kung naka-pause ito.
openmultiplayer/web/docs/translations/fil/scripting/functions/ResumeRecordingPlayback.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/ResumeRecordingPlayback.md", "repo_id": "openmultiplayer", "token_count": 112 }
373
--- title: StartRecordingPlayerData description: Nagsisimulang i-record ang mga galaw ng isang player sa isang file, na pagkatapos ay maaaring kopyahin ng isang NPC. tags: ["player"] --- ## Description Nagsisimulang i-record ang mga galaw ng isang player sa isang file, na pagkatapos ay maaaring kopyahin ng isang NPC. | Name | Description | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | playerid | Ang id ng player na i-rerecord. | | recordtype | Ang [type](../resources/recordtypes) ng recording. | | recordname[] | Ang pangalan ng file na maghahawak ng naitala na data. Ise-save ito sa direktoryo ng scriptfiles, na may awtomatikong idinagdag na .rec extension, kakailanganin mong ilipat ang file sa npcmodes/recording upang magamit para sa pag-playback. | ## Returns Ang function na ito ay hindi nagbabalik ng anumang value. ## Examples ```c if (!strcmp("/recordme", cmdtext)) { if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { StartRecordingPlayerData(playerid, PLAYER_RECORDING_TYPE_ONFOOT, "MyFile"); } else if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { StartRecordingPlayerData(playerid, PLAYER_RECORDING_TYPE_DRIVER, "MyFile"); } SendClientMessage(playerid, 0xFFFFFFFF, "All your movements are now being recorded!"); return 1; } ``` ## Related Functions - [StopRecordingPlayerData](StopRecordingPlayerData): Humihinto sa pagre-record ng data ng player.
openmultiplayer/web/docs/translations/fil/scripting/functions/StartRecordingPlayerData.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/StartRecordingPlayerData.md", "repo_id": "openmultiplayer", "token_count": 1086 }
374
--- title: OnFilterScriptExit description: Cette callback est appelée lorsqu'un filterscript a été déchargé. tags: [filterscripts, déchargé, unloaded, unload] --- ## Description Cette callback est appelée lorsqu'un filterscript a été déchargé. Elle n'est appelée que dans le filterscript qui est déchargé. ## Exemple ```c public OnFilterScriptExit() { print("\n--------------------------------------"); print(" Filterscript déchargé "); print("--------------------------------------\n"); return 1; } ``` ## Callback connnexe - [OnFilterScriptInit](OnFilterScriptInit) : chargement d'un filterscript
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnFilterScriptExit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnFilterScriptExit.md", "repo_id": "openmultiplayer", "token_count": 217 }
375
--- title: OnPlayerClickMap description: OnPlayerClickMap est appelé quand un joueur place un point (clic droit) sur la map dans le menu pause. tags: [player, ClickMap, Map, target, waypoint] --- ## Paramètres OnPlayerClickMap est appelé quand un joueur place un point (clic droit) sur la map dans le menu pause. | Nom | Description | | ---------------- | ----------------------------------------------------------------------------------------- | | `int` playerid | ID du joueur qui place le point sur la carte | | `float` Float:fX | Cordonnées X du point placé sur la carte par `playerid` | | `float` Float:fY | Coordonnées Y du point placé sur la carte par `playerid` | | `float` Float:fZ | Coordonnées Z du point placé sur la carte par `playerid` (imprécis - v. infra, "Astuces") | ## Valeur de retour Cette callback ne retourne rien, mais doit retourner quelque chose. Autrement dit, `return callback();` ne fonctionnera pas car la callback ne retourne rien, mais un return _(`return 1;` ou `return 0;`)_ doit être effectué dans la callback. ## Exemple ```c public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) { SetPlayerPosFindZ(playerid, fX, fY, fZ); SendClientMessage(playerid, -1, "Vous avez été téléporté (Risque d'imprécision)."); return 1; } ``` ## Notes :::tip Cette callback n'est appelée que quand le joueur place un point sur la carte, pas nécessairement quand il a fait un clic droit. Le `float` Z retournera une valeur de 0 (invalide) si le point du joueur est trop loin sur la carte du joueur lui-même. Utilisez le plugin MapAndreas ou ColAndreas pour résorber cette difficulté. ::: ## Callbacks connexes - [OnPlayerClickPlayer](OnPlayerClickPlayer): Quand un joueur double-clique sur le pseudo d'un autre dans la tablist. - [OnPlayerClickTextDraw](OnPlayerClickTextDraw): Quand un joueur clique sur un textdraw.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickMap.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickMap.md", "repo_id": "openmultiplayer", "token_count": 858 }
376
--- title: OnPlayerExitedMenu description: Callback appelée un joueur quitte un menu. tags: ["player", "menu"] --- ## Paramètres Callback appelée un joueur quitte un menu. | Nom | Description | | -------------- | ----------------------------------------- | | `int` playerid | ID du joueur qui quitte le menu | ## Valeur de retour Cette callback ne retourne rien, mais doit retourner quelque chose. Autrement dit, `return callback();` ne fonctionnera pas car la callback ne retourne rien, mais un return _(`return 1;` ou `return 0;`)_ doit être effectué dans la callback. ## Exemple ```c public OnPlayerExitedMenu(playerid) { TogglePlayerControllable(playerid,1); // unfreeze le joueur quand il quitte le menu return 1; } ``` ## Fonctions connexes - [CreateMenu](../functions/CreateMenu): Créer un menu. - [DestroyMenu](../functions/DestroyMenu): Détruit un menu.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerExitedMenu.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerExitedMenu.md", "repo_id": "openmultiplayer", "token_count": 352 }
377
--- title: OnPlayerSelectObject description: Cette callback est appelée quand un joueur sélectionne un objet après que SelectObject a été utilisé. tags: ["player"] --- ## Description Cette callback est appelée quand un joueur sélectionne un objet après que SelectObject a été utilisé. | Nom | Description | | ---------------- | ---------------------------------------------------- | | `int` playerid | ID du joueur qui sélectionne l'objet | | `int` type | [Type](../resources/selectobjecttypes) de sélection | | `int` objectid | ID de l'objet sélectionné | | `int` modelid | Model de l'objet sélectionné | | `float` Float:fX | Position X de l'objet sélectionné | | `float` Float:fY | Position Y de l'objet sélectionné | | `float` Float:fZ | Position Z de l'objet sélectionné | ## Valeur de retour **1** - Autorise la callback à être appelée par un autre script. **0** - Refuser que la callback soit appelée ailleurs. ## Exemple ```c public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ) { printf("Joueur %d sélectionne l'objet %d", playerid, objectid); if (type == SELECT_OBJECT_GLOBAL_OBJECT) { EditObject(playerid, objectid); } else { EditPlayerObject(playerid, objectid); } SendClientMessage(playerid, 0xFFFFFFFF, "Vous pouvez maintenant éditer la position de l'objet !"); return 1; } ``` ## Fonctions connexes - [SelectObject](../functions/SelectObject): Sélectionne un objet.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerSelectObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerSelectObject.md", "repo_id": "openmultiplayer", "token_count": 741 }
378
--- title: OnVehicleDamageStatusUpdate description: Cette callback est appelée lorsqu'un élément de véhicule - tel que les portes ou les phares - sont endommagés. tags: ["vehicle"] --- :::tip Voir ["damagestatus"](../resources/damagestatus). ::: ## Description Cette callback est appelée lorsqu'un élément de véhicule - tel que les portes ou les phares - sont endommagés. | Nom | Description | | --------------- | --------------------------------------- | | `int` vehicleid | L'ID du véhicule qui a été endommagé | | `int` playerid | L'ID du joueur qui a infligé les dégâts | ## Valeur de retour Cette callback ne retourne rien, mais doit retourner quelque chose. Autrement dit, `return callback();` ne fonctionnera pas car la callback ne retourne rien, mais un return _(`return 1;` ou `return 0;`)_ doit être effectué dans la callback. ## Exemples ```c // example code: protect vehicle tires from being popped // uses encode_tires function from: http://forum.sa-mp.com/index.php?topic=161491.msg960040#msg960040 public OnVehicleDamageStatusUpdate(vehicleid, playerid) { #pragma unused playerid new panels, doors, lights, tires; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); tires = encode_tires(0, 0, 0, 0); // fix all tires panels = encode_panels(0, 0, 0, 0, 0, 0, 0); // fix all panels //fell off - (3, 3, 3, 3, 3, 3, 3) doors = encode_doors(0, 0, 0, 0, 0, 0); // fix all doors //fell off - (4, 4, 4, 4, 0, 0) lights = encode_lights(0, 0, 0, 0); // fix all lights UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); return 1; } encode_tires(tire1, tire2, tire3, tire4) return tire1 | (tire2 << 1) | (tire3 << 2) | (tire4 << 3); encode_panels(flp, frp, rlp, rrp, windshield, front_bumper, rear_bumper) { return flp | (frp << 4) | (rlp << 8) | (rrp << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24); } encode_doors(bonnet, boot, driver_door, passenger_door, behind_driver_door, behind_passenger_door) { #pragma unused behind_driver_door #pragma unused behind_passenger_door return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24); } encode_lights(light1, light2, light3, light4) { return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3); } ``` ## Astuces :::tip Cela n'inclut pas les changements de heal du véhicule. ::: ## Fonctions connexes - [GetVehicleDamageStatus](../functions/GetVehicleDamageStatus): Récupère les dégâts de chaque partie d'un véhicule. - [UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus): Met à jour les dégâts d'un véhicule.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehicleDamageStatusUpdate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehicleDamageStatusUpdate.md", "repo_id": "openmultiplayer", "token_count": 1050 }
379
--- title : "Compensation des décalages" description : Explication de la compensation de décalage. --- La compensation de décalage pour les balles tirées est activée par défaut sur les serveurs SA-MP depuis 0.3z. Il peut être basculé à l'aide de la variable de serveur `lagcompmode` dans [server.cfg](server.cfg). Le régler sur 0 désactivera complètement la compensation de décalage et les joueurs devront diriger leurs tirs (tirer devant les cibles). La désactivation de la compensation de décalage empêchera [OnPlayerWeaponShot](../scripting/callbacks/OnPlayerWeaponShot) d'être appelé. Cette variable ne peut être définie que dans [server.cfg](server.cfg).
openmultiplayer/web/docs/translations/fr/server/LagCompensation.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/server/LagCompensation.md", "repo_id": "openmultiplayer", "token_count": 219 }
380
--- title: Client description: Kategori ini berisi informasi mengenai fitur client SA-MP beserta dukungannya. --- Kategori ini berisi informasi mengenai fitur client SA-MP beserta dukungannya.
openmultiplayer/web/docs/translations/id/client/_.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/client/_.md", "repo_id": "openmultiplayer", "token_count": 69 }
381
--- title: OnPlayerClickPlayer description: Terpanggil ketika pemain mengklik dua kali pemain yang berada di scoreboard. tags: ["player"] --- ## Deskripsi Terpanggil ketika pemain mengklik dua kali pemain yang berada di scoreboard. | Name | Description | | --------------- | -------------------------------------------------------------- | | playerid | ID dari pemain yang mengklik pemain yang berada di scoreboard. | | clickedplayerid | ID dari pemain yang di klik oleh playerid. | | source | Sumber yang player klik. | ## Returns 0 - Akan melarang filterscript lain untuk menerima callback ini. 1 - Mengindikasikan bahwa callback ini akan dilanjutkan ke filtercript lain. Selalu terpanggil pertama di filterscripts. ## Contoh ```c public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) { new message[32]; format(message, sizeof(message), "Anda mengklik pada pemain ID: %d", clickedplayerid); SendClientMessage(playerid, 0xFFFFFFFF, message); return 1; } ``` ## Catatan :::tip Saat ini hanya ada satu 'source' (0 - CLICK_SOURCE_SCOREBOARD). Keberadaan argumen ini menunjukkan akan adanya sumber lain yang akan didukung di masa depan nanti. ::: ## Fungsi Terkait - [OnPlayerClickTextDraw](OnPlayerClickTextDraw.md): Terpanggil ketika player mengklik pada textdraw.
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerClickPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerClickPlayer.md", "repo_id": "openmultiplayer", "token_count": 594 }
382
--- title: OnPlayerStateChange description: Callback ini akan terpanggil ketika pemain melakukan perubahan status. tags: ["player"] --- ## Deskripsi Callback ini akan terpanggil ketika pemain melakukan perubahan status. (misalnya saat player yang sedang mengendarai) | Nama | Deskripsi | | -------- | ---------------------------------------- | | playerid | ID dari pemain yang melakukan perubahan status. | | newstate | Status baru dari player. | | oldstate | Status lama dari player. | Pergi ke [Player States](../resources/playerstates) untuk list semua variable player state. ## Returns Selalu terpanggil pertama di filterscripts. ## Contoh ```c public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Pemain menaiki kendaraan (Wajib Mobil) dan menjadi supir { new vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); // Menambahkan NOS ke Kendaraan Anda } return 1; } ``` ## Catatan :::tip Callback ini juga dipanggil oleh NPC ::: ## Fungsi Terkait - [GetPlayerState](../functions/GetPlayerState): Mendapatkan status pemain saat ini - [GetPlayerSpecialAction](../functions/GetPlayerSpecialAction): Mendapatkan animasi spesial pemain saat ini. - [SetPlayerSpecialAction](../functions/SetPlayerSpecialAction): Mengatur animasi spesial pemain.
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerStateChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerStateChange.md", "repo_id": "openmultiplayer", "token_count": 588 }
383
--- title: DestroyObject description: Menghancurkan (menghapus) Object yang dibuat menggunakan CreateObject. tags: [] --- ## Deskripsi Menghancurkan (menghapus) Object yang dibuat menggunakan CreateObject.. | Name | Description | | -------- | ---------------------------------------------------------------- | | objectid | ID Object yang akan dihancurkan. Dikembalikan oleh CreateObject. | ## Returns Function ini tidak mengembalikan nilai tertentu. ## Contoh ```c public OnObjectMoved(objectid) { DestroyObject(objectid); return 1; } ``` ## Fungsi Terkait - [CreateObject](CreateObject): Membuat suatu Object. - [IsValidObject](IsValidObject): Memeriksa apakah Object tertentu valid. - [MoveObject](MoveObject): Memindahkan suatu Object. - [StopObject](StopObject): Menghentikan suatu Object agar tidak bergerak. - [SetObjectPos](SetObjectPos): Mengatur posisi suatu Object. - [SetObjectRot](SetObjectRot): Mengatur rotasi suatu Object. - [GetObjectPos](GetObjectPos): Mencari Object. - [GetObjectRot](GetObjectRot): Memeriksa rotasi suatu Object. - [AttachObjectToPlayer](AttachObjectToPlayer): Menambahkan Object ke Player. - [CreatePlayerObject](CreatePlayerObject): Membuat Object hanya untuk satu Player. - [DestroyPlayerObject](DestroyPlayerObject): Menghapus suatu Object dari Player. - [IsValidPlayerObject](IsValidPlayerObject): Memeriksa apakah Object Player tertentu valid. - [MovePlayerObject](MovePlayerObject): Memindahkan Object Player. - [StopPlayerObject](StopPlayerObject): Menghentikan Object Player agar tidak bergerak. - [SetPlayerObjectPos](SetPlayerObjectPos): Mengatur posisi Object Player. - [SetPlayerObjectRot](SetPlayerObjectRot): Mengatur rotasi Object Player. - [GetPlayerObjectPos](GetPlayerObjectPos): Mencari Object Player. - [GetPlayerObjectRot](GetPlayerObjectRot): Memeriksa rotasi Object Player. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Menambahkan Object pemain ke Player.
openmultiplayer/web/docs/translations/id/scripting/functions/DestroyObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/DestroyObject.md", "repo_id": "openmultiplayer", "token_count": 646 }
384
--- title: strfind description: Mencari sebuah sub-string di dalam sebuah string. tags: ["string"] --- <LowercaseNote /> ## Deskripsi Mencari sebuah sub-string di dalam sebuah string. | Nama | Deskripsi | | --------------------- | -------------------------------------------------------------------------------------------------------------------- | | const string[] | String yang ingin anda telusuri (haystack). | | const sub[] | String yang ingin anda cari (needle). | | ignorecase (opsional) | Saat di set true, besar/kecil huruf tidak mempengaruhi - HeLLo sama dengan Hello. Saat di set false, mereka berbeda. | | Position (opsional) | Posisi untuk memulai pencarian | ## Returns Jumlah karakter sebelum sub-string (posisi awal sub-string) atau -1 jika tidak ditemukan. ## Contoh ```c if (strfind("Are you in here?", "you", true) != -1) //me-return 4, karena awalan 'you' (y) ada di indeks 4 dalam string { SendClientMessageToAll(0xFFFFFFFF, "I found you!"); } ``` ## Fungsi Terkait - [strcmp](strcmp): Membanding dua string untuk mengecek apakah mereka sama. - [strdel](strdel): Menghapus bagian dari sebuah string. - [strins](strins): Memasukkan teks kedalam sebuah string. - [strlen](strlen): Mendapatkan panjang dari sebuah string. - [strmid](strmid): Mengekstrak bagian dari sebuah string ke string lainnya. - [strpack](strpack): Membungkus sebuah string menjadi string baru. - [strval](strval): Mengkonversi sebuah string menjadi integer. - [strcat](strcat): Menggabungkan dua buah string menjadi sebuah string.
openmultiplayer/web/docs/translations/id/scripting/functions/strfind.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/strfind.md", "repo_id": "openmultiplayer", "token_count": 919 }
385
--- title: ID Cuaca description: Informasi tentang ID cuaca --- Informasi ini untuk digunakan dengan [SetWeather](../functions/SetWeather) dan [SetPlayerWeather](../functions/SetPlayerWeather). ```c 0 = EXTRASUNNY_LA 1 = SUNNY_LA 2 = EXTRASUNNY_SMOG_LA 3 = SUNNY_SMOG_LA 4 = CLOUDY_LA 5 = SUNNY_SF 6 = EXTRASUNNY_SF 7 = CLOUDY_SF 8 = RAINY_SF 9 = FOGGY_SF 10 = SUNNY_VEGAS 11 = EXTRASUNNY_VEGAS (gelombang panas) 12 = CLOUDY_VEGAS 13 = EXTRASUNNY_COUNTRYSIDE 14 = SUNNY_COUNTRYSIDE 15 = CLOUDY_COUNTRYSIDE 16 = RAINY_COUNTRYSIDE 17 = EXTRASUNNY_DESERT 18 = SUNNY_DESERT 19 = SANDSTORM_DESERT 20 = UNDERWATER (kehijauan, berkabut) ``` Ada 21 jenis ID cuaca (0-20), bagaimanapun _game_ tidak ada pemeriksaan rentang ID cuaca dan demikian Anda bisa menggunakan ID cuaca hingga 255. Nilai lebih tinggi dari 255 atau di bawah 0 akan berubah menjadi sisa hasil pembagian dari 256 (sebagai contoh, ID cuaca 300 sama dengan ID 44, jareba 300 % 256 = 44). ID cuaca 0-22 bekerja dengan baik, tapi ID lainnya menghasilkan efek yang aneh, seperti langit merah muda dan tekstur berkilat di waktu tertentu. :::note - Beberapa cuaca muncul sangat berbeda di waktu tertentu. Anda bisa melihatnya di [sini](http://hotmist.ddo.jp/id/weather.html) seperti apa perbedaan jenis cuaca di waktu yang berbeda. - [Galeri cuaca GTA San Andreas](https://dev.prineside.com/en/gtasa_weather_id/) menjelaskan siatuasinya dengan ID cuaca lebih baik daripada apapun. Anda bisa menggunakannya jika Anda ingin melihat cuaca di waktu-waktu tertentu dan lihat juga permasalah cuaca yang menyebabkan efek aneh. :::
openmultiplayer/web/docs/translations/id/scripting/resources/weatherid.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/resources/weatherid.md", "repo_id": "openmultiplayer", "token_count": 679 }
386
--- title: AddMenuItem description: Dodaje element do konkretnego menu. Tags: ["menu"] --- ## Opis Dodaje element do konkretnego menu. | Nazwa | Opis | | ------- | ------------------------------------------------- | | menuid | ID menu, do którego element ma zostać dodany. | | column | Kolumna, do której dana pozycja ma zostać dodana. | | title[] | Tytuł nowego elementu w menu. | ## Zwracane wartości Indeks rzędu, do którego element został dodany. ## Przykłady ```c new Menu:examplemenu; public OnGameModeInit() { examplemenu = CreateMenu("Twoje menu", 2, 200.0, 100.0, 150.0, 150.0); AddMenuItem(examplemenu, 0, "element 1"); AddMenuItem(examplemenu, 0, "element 2"); return 1; } ``` ## Uwagi :::tip Podanie nieprawidłowego ID menu powoduje crash. Możesz mieć tylko 12 elementów w każdym menu (13 przechodzi na prawą stronę nagłówka nazwy kolumny (pokolorowany), 14 i większe nie są wyświetlane wcale. Możesz używać tylko 2 kolumn (0 i 1). Możesz dodać tylko 8 kolorów do jednego elementu (~r~, ~g~, itd.). Maksymalna długość elementu menu to 31 znaków. ::: ## Powiązane funkcje - [CreateMenu](CreateMenu.md): Tworzy menu. - [SetMenuColumnHeader](SetMenuColumnHeader.md): Ustawia nagłówek dla jednej z kolumn w menu. - [DestroyMenu](DestroyMenu.md): Kasuje menu. - [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow.md): Wywoływane, gdy gracz wybrał rząd w menu. - [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu.md): Wywoływane, gdy gracz zamknie menu.
openmultiplayer/web/docs/translations/pl/scripting/functions/AddMenuItem.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AddMenuItem.md", "repo_id": "openmultiplayer", "token_count": 716 }
387
--- title: AttachCameraToObject description: Możesz używać tej funkcji, aby przyczepiać kamerę gracza do obiektów. tags: [] --- ## Opis Możesz używać tej funkcji, aby przyczepiać kamerę gracza do obiektów. | Nazwa | Opis | | -------- | --------------------------------------------------------- | | playerid | ID gracza, którego kamera będzie przyczepiona do obiektu. | | objectid | ID obiektu, do którego chcesz przyczepić kamerę gracza. | ## Zwracane wartości Ta funkcja nie zwraca żadnych konkretnych wartości. ## Przykłady ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/attach", false)) { new objectId = CreateObject(1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0); AttachCameraToObject(playerid, objectId); SendClientMessage(playerid, 0xFFFFFFAA, "Twoja kamera została przyczepiona do obiektu."); return 1; } return 0; } ``` ## Uwagi :::tip Musisz najpierw utworzyć obiekt, zanim spróbujesz przyczepić do niego kamerę gracza. ::: ## Powiązane funkcje - [AttachCameraToPlayerObject](AttachCameraToPlayerObject): Przyczepia kamerę gracza do
openmultiplayer/web/docs/translations/pl/scripting/functions/AttachCameraToObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AttachCameraToObject.md", "repo_id": "openmultiplayer", "token_count": 572 }
388
--- title: Bem-vindo sidebar_label: Bem-vindo --- Bem-vindo ao SA-MP wiki, mantido pelo time do open.mp e uma grande comunidade do SA-MP! Este site tem como objetivo fornecer uma fonte de documentação de fácil acesso e contribuição para SA-MP e, eventualmente, open.mp. ## A Wiki do SA-MP se foi Infelizmente, o SA-MP Wiki foi desativado em meados de setembro, mas precisamos da ajuda da comunidade para transferir e manter a antiga documentação da velha wiki para sua nova casa, aqui! Felizmente boa parte de toda a documentação já foi transferida. Se estiver interessado, acesse [esta página](/pt-BR/docs/meta/Contributing) para mais informações e guias. Se você não tiver experiência com o uso do GitHub ou conversão de HTML, não se preocupe! Você pode ajudar nos informando sobre problemas (via [Discord](https://discord.gg/samp), [Fórum do open.mp](https://forum.open.mp) ou Mídias Sociais) e a parte mais importante: _divulgando tudo_. Então tenha certeza de guardar este site e compartilhar com qualquer pessoa que conheça que está se perguntando para onde o SA-MP Wiki foi. Aceitamos contribuições para melhorias na documentação, assim como tutoriais e guias para tarefas simples como construir uma gamemode e como usar plugins e bibliotecas. Se você estiver interessado em contribuir então vá para a [página do GitHub](https://github.com/openmultiplayer/web).
openmultiplayer/web/docs/translations/pt-BR/index.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/index.md", "repo_id": "openmultiplayer", "token_count": 517 }
389
--- title: OnNPCExitVehicle description: Essa callback é executada quando um NPC sai de um veículo. tags: [] --- ## Descrição Essa callback é executada quando um NPC sai de um veículo. ## Exemplos ```c public OnNPCExitVehicle() { print("O NPC saiu do veículo."); return 1; } ``` ## Callbacks Relacionadas - [OnNPCEnterVehicle](../callbacks/OnNPCEnterVehicle): Executada quando um NPC entra em um veículo.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCExitVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCExitVehicle.md", "repo_id": "openmultiplayer", "token_count": 164 }
390
--- title: OnPlayerEnterRaceCheckpoint description: Esta callback é chamada quando um jogador entra em um checkpoint de corrida. tags: ["player", "checkpoint", "racecheckpoint"] --- ## Descrição Esta callback é chamada quando um jogador entra em um checkpoint de corrida. | Nome | Descrição | | -------- | -------------------------------------------------- | | playerid | O ID do jogador que entrou no chekpoint de corrida | ## Retorno Sempre é chamada primeiro em filterscripts. ## Exemplos ```c public OnPlayerEnterRaceCheckpoint(playerid) { printf("Jogador %d entrou em um checkpoint de corrida!", playerid); return 1; } ``` ## Notas <TipNPCCallbacksPT /> ## Funções Relacionadas - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint.md): Cria o checkpoint para um jogador. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint.md): Desativa o atual checkpoint do jogador. - [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Verifica se o jogador está em checkpoint. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint.md): Cria um checkpoint de corrida. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint.md): Desativa o atual checkpoint de corrida do jogador. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Verifica se o jogador está em um checkpoint de corrida.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 476 }
391
--- title: OnPlayerSelectObject description: Esta callback é chamada quando um jogador seleciona um objeto após SelectObject ser usado. tags: ["player"] --- ## Descrição Esta callback é chamada quando um jogador seleciona um objeto após SelectObject ser usado. | Nome | Descrição | | -------- | ---------------------------------------------------------- | | playerid | O ID do jogador que selecionou o objeto | | type | O [tipo](../resources/selectobjecttypes) de seleção | | objectid | O ID do objeto selecionado | | modelid | O MODELO do objeto selecionado | | Float:fX | A posição X do objeto selecionado | | Float:fY | A posição Y do objeto selecionado | | Float:fZ | A posição Z do objeto selecionado | ## Retorno 1 - Irá previnir que outro filterscript receba esta callback. 0 - Indica que esta callback será passada para o próximo filterscript. Sempre é chamada primeiro em filterscripts. ## Exemplos ```c public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ) { printf("Jogador %d selecionou o objeto %d", playerid, objectid); if (type == SELECT_OBJECT_GLOBAL_OBJECT) { EditObject(playerid, objectid); } else { EditPlayerObject(playerid, objectid); } SendClientMessage(playerid, 0xFFFFFFFF, "Agora você pode editar seu objeto""); return 1; } ``` ## Funções Relacionadas - [SelectObject](../functions/SelectObject): Seleciona um objeto.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerSelectObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerSelectObject.md", "repo_id": "openmultiplayer", "token_count": 756 }
392