text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
--- title: GetPlayerClass description: Get the class data. tags: ["class"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the class data. | Name | Description | | ------------- | ------------------------------------------------------------- | | classid | The class id to get data from. | | &team | A variable in which to store the team in, passed by reference. | | &skin | A variable in which to store the skin in, passed by reference. | | &Float:spawnX | A float variable in which to store the X coordinate in, passed by reference. | | &Float:spawnY | A float variable in which to store the Y coordinate in, passed by reference. | | &Float:spawnZ | A float variable in which to store the Z coordinate in, passed by reference. | | &Float:angle | A float variable in which to store the angle coordinate in, passed by reference. | | &WEAPON:weapon1 | A variable in which to store the weapon1 in, passed by reference. | | &ammo1 | A variable in which to store the ammo1 in, passed by reference. | | &WEAPON:weapon2 | A variable in which to store the weapon2 in, passed by reference. | | &ammo2 | A variable in which to store the ammo2 in, passed by reference. | | &WEAPON:weapon3 | A variable in which to store the weapon3 in, passed by reference. | | &ammo3 | A variable in which to store the ammo3 in, passed by reference. | ## Examples ```c new classid = 10, team, skin, Float:spawnX, Float:spawnY, Float:spawnZ, Float:angle, WEAPON:weapon1, ammo1, WEAPON:weapon2, ammo2, WEAPON:weapon3, ammo3; GetPlayerClass(classid, team, skin, spawnX, spawnY, spawnZ, angle, weapon1, ammo1, weapon2, ammo2, weapon3, ammo3); printf("[Class id %d data]\n\ team: %d\n\ skin: %d\n\ spawnX: %f\n\ spawnY: %f\n\ spawnZ: %f\n\ angle: %f\n\ weapon1: %d\n\ ammo1: %d\n\ weapon2: %d\n\ ammo2: %d\n\ weapon3: %d\n\ ammo3: %d", classid, team, skin, spawnX, spawnY, spawnZ, angle, weapon1, ammo1, weapon2, ammo2, weapon3, ammo3); ``` ## Related Functions - [AddPlayerClass](AddPlayerClass): Adds a class. - [AddPlayerClassEx](AddPlayerClassEx): Add a class with a default team. - [GetAvailableClasses](GetAvailableClasses): Get the number of classes defined.
openmultiplayer/web/docs/scripting/functions/GetPlayerClass.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerClass.md", "repo_id": "openmultiplayer", "token_count": 906 }
289
--- title: GetPlayerObjectMoveSpeed description: Get the move speed of a player-object. tags: ["player", "object", "playerobject"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the move speed of a player-object. | Name | Description | |----------|-------------------------------------------------------| | playerid | The ID of the player. | | objectid | The ID of the player-object to get the move speed of. | ## Returns Returns the move speed as float. ## Examples ```c new playerobjectid = CreatePlayerObject(playerid, 985, 1003.39154, -643.33423, 122.35060, 0.00000, 1.00000, 24.00000); MovePlayerObject(playerid, playerobjectid, 1003.3915, -643.3342, 114.5122, 0.8); new Float:moveSpeed = GetPlayerObjectMoveSpeed(playerid, playerobjectid); // moveSpeed = 0.8 ``` ## Related Functions - [MovePlayerObject](MovePlayerObject): Move a player object to a new position with a set speed. - [SetPlayerObjectMoveSpeed](SetPlayerObjectMoveSpeed): Set the move speed of a player-object. - [GetObjectMoveSpeed](GetObjectMoveSpeed): Get the move speed of an object.
openmultiplayer/web/docs/scripting/functions/GetPlayerObjectMoveSpeed.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerObjectMoveSpeed.md", "repo_id": "openmultiplayer", "token_count": 410 }
290
--- title: GetPlayerScore description: This function returns a player's score as it was set using SetPlayerScore. tags: ["player"] --- ## Description This function returns a player's score as it was set using SetPlayerScore | Name | Description | | -------- | ------------------------------- | | playerid | The player to get the score of. | ## Returns The player's score. ## Examples ```c public OnPlayerCommandText(playerid,text[]) { if (!strcmp(cmdtext, "/score", true)) { new string[32]; format(string, sizeof(string), "Your score: %i", GetPlayerScore(playerid)); SendClientMessage(playerid, COLOR_ORANGE, string); return 1; } return 0; } ``` ## Related Functions - [SetPlayerScore](SetPlayerScore): Set the score of a player. - [GetPlayerPing](GetPlayerPing): Get the ping of a player.
openmultiplayer/web/docs/scripting/functions/GetPlayerScore.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerScore.md", "repo_id": "openmultiplayer", "token_count": 301 }
291
--- title: GetPlayerTrainSpeed description: Gets the speed of the player's train. tags: ["player", "vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Gets the speed of the player's train. ## Parameters | Name | Description | |----------|-----------------------| | playerid | The ID of the player. | ## Examples ```c new Float:speed = GetPlayerTrainSpeed(playerid); SendClientMessage(playerid, 0xFFFF00FF, "The speed of your train: %f", speed); ``` ## Related Functions - [GetVehicleTrainSpeed](GetVehicleTrainSpeed): Gets the speed of the train.
openmultiplayer/web/docs/scripting/functions/GetPlayerTrainSpeed.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerTrainSpeed.md", "repo_id": "openmultiplayer", "token_count": 193 }
292
--- title: GetVehicleColours description: Gets the vehicle colours. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Gets the vehicle colours. ## Parameters | Name | Description | |-----------|----------------------------------------------------------------------| | vehicleid | The ID of the vehicle. | | &colour1 | A variable in which to store the colour1 value, passed by reference. | | &colour2 | A variable in which to store the colour2 value, passed by reference. | ## Examples ```c public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); new colour1, colour2; GetVehicleColours(vehicleid, colour1, colour2); // colour1 = 6 // colour2 = 0 return 1; } ``` ## Related Functions - [ChangeVehicleColours](ChangeVehicleColours): Change a vehicle's primary and secondary colors. ## Related Resources - [Vehicle Colour IDs](../resources/vehiclecolorid)
openmultiplayer/web/docs/scripting/functions/GetVehicleColours.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleColours.md", "repo_id": "openmultiplayer", "token_count": 433 }
293
--- title: GetVehicleNumberPlate description: Get the number plate of a vehicle. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the number plate of a vehicle. ## Parameters | Name | Description | |----------------------|-------------------------------------------------------------| | vehicleid | The ID of the vehicle. | | plate[] | An array into which to store the name, passed by reference. | | len = sizeof (plate) | The length of the plate that should be stored. | ## Examples ```c public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 6, 0, 100); SetVehicleNumberPlate(vehicleid, "ABCD 123"); new numberPlate[16]; GetVehicleNumberPlate(vehicleid, numberPlate); // numberPlate = "ABCD 123" return 1; } ``` ## Related Functions - [SetVehicleNumberPlate](SetVehicleNumberPlate): Set a vehicle numberplate.
openmultiplayer/web/docs/scripting/functions/GetVehicleNumberPlate.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleNumberPlate.md", "repo_id": "openmultiplayer", "token_count": 438 }
294
--- title: GetVehicleTrailer description: Get the ID of the trailer attached to a vehicle. tags: ["vehicle"] --- ## Description Get the ID of the trailer attached to a vehicle. | Name | Description | | --------- | -------------------------------------------- | | vehicleid | The ID of the vehicle to get the trailer of. | ## Returns The vehicle ID of the trailer or 0 if no trailer is attached. ## Examples ```c new trailerId = GetVehicleTrailer(vehicleid); DetachTrailerFromVehicle(trailerId); ``` ## Notes :::warning This function does not work for trains. ::: ## Related Functions - [AttachTrailerToVehicle](AttachTrailerToVehicle): Attach a trailer to a vehicle. - [DetachTrailerFromVehicle](DetachTrailerFromVehicle): Detach a trailer from a vehicle. - [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): Check if a trailer is attached to a vehicle.
openmultiplayer/web/docs/scripting/functions/GetVehicleTrailer.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleTrailer.md", "repo_id": "openmultiplayer", "token_count": 294 }
295
--- title: IsGangZoneVisibleForPlayer description: Check if the gangzone is visible for player tags: ["player", "gangzone"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Check if the gangzone is visible for player. | Name | Description | | ----------- | ----------------------------------------- | | playerid | The ID of the player to check for. | | zoneid | The ID of the gangzone. | ## Returns **true** - The gangzone is visible for player. **false** - The gangzone is not visible for player. ## 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. - [IsValidGangZone](IsValidGangZone): Check if the gangzone valid. - [IsPlayerInGangZone](IsPlayerInGangZone): Check if the player in gangzone.
openmultiplayer/web/docs/scripting/functions/IsGangZoneVisibleForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsGangZoneVisibleForPlayer.md", "repo_id": "openmultiplayer", "token_count": 497 }
296
--- title: IsPlayerGangZoneFlashing description: Check if the player gangzone is flashing tags: ["player", "gangzone", "playergangzone"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Check if the player gangzone is flashing. | Name | Description | | ----------- | ---------------------------------------------------------------- | | playerid | The ID of the player to whom player gangzone is bound. | | zoneid | The ID of the player gangzone. | ## Returns **true** - The player gangzone is flashing. **false** - The player gangzone is not flashing. ## Examples ```c new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) { // Create the gangzone gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); // Show the gangzone to player PlayerGangZoneShow(playerid, gGangZoneID[playerid], 0xFF0000FF); return 1; } public OnPlayerSpawn(playerid) { // Start player gangzone flash PlayerGangZoneFlash(playerid, gGangZoneID[playerid], 0x45D1ABFF); return 1; } public OnPlayerDeath(playerid, killerid, WEAPON:reason) { if (IsPlayerGangZoneFlashing(playerid, gGangZoneID[playerid])) { PlayerGangZoneStopFlash(playerid, gGangZoneID[playerid]); } return 1; } ``` ## Related Functions - [CreatePlayerGangZone](CreatePlayerGangZone): Create player gangzone. - [PlayerGangZoneDestroy](PlayerGangZoneDestroy): Destroy player gangzone. - [PlayerGangZoneShow](PlayerGangZoneShow): Show player gangzone. - [PlayerGangZoneHide](PlayerGangZoneHide): Hide player gangzone. - [PlayerGangZoneFlash](PlayerGangZoneFlash): Start player gangzone flash. - [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): Stop player gangzone flash. - [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): Get the flashing colour of a player gangzone. - [PlayerGangZoneGetColour](PlayerGangZoneGetColour): Get the colour of a player gangzone. - [PlayerGangZoneGetPos](PlayerGangZoneGetPos): Get the position of a gangzone, represented by minX, minY, maxX, maxY coordinates. - [IsValidPlayerGangZone](IsValidPlayerGangZone): Check if the player gangzone valid. - [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): Check if the player in player gangzone. - [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): Check if the player gangzone is visible. - [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): Enables the callback when a player enters/leaves this zone.
openmultiplayer/web/docs/scripting/functions/IsPlayerGangZoneFlashing.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsPlayerGangZoneFlashing.md", "repo_id": "openmultiplayer", "token_count": 906 }
297
--- title: IsPlayerSpawned description: Checks if a player is spawned. tags: ["player"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Checks if a player is spawned. | Name | Description | |----------|--------------------------------| | playerid | The ID of the player to check. | ## Returns **true** - The player is spawned. **false** - The player is not spawned. ## Examples ```c public OnPlayerText(playerid, text[]) { if (!IsPlayerSpawned(playerid)) { SendClientMessage(playerid, COLOR_RED, "ERROR: You must be spawned to send messages."); return 0; } return 1; } ``` ## Related Functions - [SpawnPlayer](SpawnPlayer): (Re)Spawns a player.
openmultiplayer/web/docs/scripting/functions/IsPlayerSpawned.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsPlayerSpawned.md", "repo_id": "openmultiplayer", "token_count": 263 }
298
--- title: IsValidObject description: Checks if an object with the ID provided exists. tags: ["object"] --- ## Description Checks if an object with the ID provided exists. | Name | Description | | -------- | ----------------------------------------------- | | objectid | The ID of the object to check the existence of. | ## Returns **true** - The object exists. **false** - The object does not exist. ## Examples ```c new objectid; public OnGameModeInit() { objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0); return 1; } public OnGameModeExit() { if (IsValidObject(objectid)) { DestroyObject(objectid); } return 1; } ``` ## Notes :::warning This is to check if an object exists, not if a model is valid. ::: ## Related Functions - [CreateObject](CreateObject): Create an object. - [DestroyObject](DestroyObject): Destroy an object. - [MoveObject](MoveObject): Move an object. - [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. - [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](AttachPlayerObjectToPlayer): Attach a player object to a player.
openmultiplayer/web/docs/scripting/functions/IsValidObject.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsValidObject.md", "repo_id": "openmultiplayer", "token_count": 647 }
299
--- title: NetStats_PacketLossPercent description: Gets the packet loss percentage of a player. tags: ["network monitoring"] --- ## Description Gets the packet loss percentage of a player. Packet loss means data the player is sending to the server is being lost (or vice-versa). | Name | Description | | -------- | ------------------------------------------ | | playerid | The ID of the player to get the data from. | ## Returns The percentage packet loss as a float. 0 if player not connected. ## Examples ```c public OnPlayerCommandText(playerid,cmdtext[]) { if (!strcmp(cmdtext, "/packetloss")) { new szString[144]; format(szString, sizeof(szString), "Packets lost: %.2f percent.", NetStats_PacketLossPercent(playerid)); SendClientMessage(playerid, -1, szString); } return 1; } ``` ## Notes :::tip This function has been found to be currently unreliable the output is not as expected when compared to the client. Therefore this function should not be used as a packet loss kicker. A more accurate packetloss function: ```c stock GetPlayerPacketLoss(playerid, &Float:packetLoss) { /* Returns the packetloss percentage of the given playerid - Made by Fusez */ if(!IsPlayerConnected(playerid)) { return 0; } new nstats[400+1], nstats_loss[20], start, end; GetPlayerNetworkStats(playerid, nstats, sizeof (nstats)); start = strfind(nstats, "packetloss", true); end = strfind(nstats, "%", true, start); strmid(nstats_loss, nstats, start+12, end, sizeof (nstats_loss)); packetLoss = floatstr(nstats_loss); return 1; } ``` ::: :::tip Be advised that this function will report the packets lost by the server. The packet loss number reported by the client **will** be different, not because either is incorrect, but because both the server and the client are only aware of the loss packages sent by them. ::: :::tip Anything greater than 0.0% should already be a cause of concern. Anything greater than 1.0% is outright bad. ::: ## Related Functions - [GetPlayerNetworkStats](GetPlayerNetworkStats): Gets a player's networkstats and saves it into a string. - [GetNetworkStats](GetNetworkStats): Gets the server's networkstats and saves it into a string. - [NetStats_GetConnectedTime](NetStats_GetConnectedTime): Get the time that a player has been connected for. - [NetStats_MessagesReceived](NetStats_MessagesReceived): Get the number of network messages the server has received from the player. - [NetStats_BytesReceived](NetStats_BytesReceived): Get the amount of information (in bytes) that the server has received from the player. - [NetStats_MessagesSent](NetStats_MessagesSent): Get the number of network messages the server has sent to the player. - [NetStats_BytesSent](NetStats_BytesSent): Get the amount of information (in bytes) that the server has sent to the player. - [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): Get the number of network messages the server has received from the player in the last second. - [NetStats_ConnectionStatus](NetStats_ConnectionStatus): Get a player's connection status. - [NetStats_GetIpPort](NetStats_GetIpPort): Get a player's IP and port.
openmultiplayer/web/docs/scripting/functions/NetStats_PacketLossPercent.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/NetStats_PacketLossPercent.md", "repo_id": "openmultiplayer", "token_count": 988 }
300
--- title: PlayerTextDrawAlignment description: Set the text alignment of a player-textdraw. tags: ["player", "textdraw", "playertextdraw"] --- ## Description Set the text alignment of a player-textdraw. | Name | Description | | ------------------------- | --------------------------------------------------------------------------- | | playerid | The ID of the player whose player-textdraw to set the alignment of. | | PlayerText:textid | The ID of the player-textdraw to set the alignment of. | | TEXT_DRAW_ALIGN:alignment | `TEXT_DRAW_ALIGN_LEFT` / `TEXT_DRAW_ALIGN_CENTER` / `TEXT_DRAW_ALIGN_RIGHT` | ## Returns This function does not return any specific values. ## Examples ```c /* TEXT_DRAW_ALIGN_LEFT TEXT_DRAW_ALIGN_CENTER TEXT_DRAW_ALIGN_RIGHT */ new PlayerText:gMyTextdraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) { gMyTextdraw[playerid] = CreatePlayerTextDraw(playerid, 320.0, 425.0, "This is an example textdraw"); PlayerTextDrawAlignment(playerid, gMyTextdraw[playerid], TEXT_DRAW_ALIGN_CENTER); // Align the textdraw in the center return 1; } ``` ## Notes :::warning For alignment 2 (TEXT_DRAW_ALIGN_CENTER) the x and y values of TextSize need to be swapped, see notes at [PlayerTextDrawTextSize](PlayerTextDrawTextSize). ::: :::tip If the textdraw is already shown for the player, it must be re-shown ([PlayerTextDrawShow](PlayerTextDrawShow)) to show the changes of this function. ::: ## Related Functions - [CreatePlayerTextDraw](CreatePlayerTextDraw): Create a player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Destroy a player-textdraw. - [PlayerTextDrawGetAlignment](PlayerTextDrawGetAlignment): Gets the text alignment of a player-textdraw. - [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. - [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. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Scale the text spacing in a player-textdraw to a proportional ratio. - [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.
openmultiplayer/web/docs/scripting/functions/PlayerTextDrawAlignment.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/PlayerTextDrawAlignment.md", "repo_id": "openmultiplayer", "token_count": 1023 }
301
--- title: PlayerTextDrawSetOutline description: Set the outline of a player-textdraw. tags: ["player", "textdraw", "playertextdraw"] --- ## Description Set the outline of a player-textdraw. The outline colour cannot be changed unless [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor) is used. | Name | Description | | ----------------- | ---------------------------------------------------------------- | | playerid | The ID of the player whose player-textdraw to set the outline of | | PlayerText:textid | The ID of the player-textdraw to set the outline of | | outlineSize | The thickness of the outline. | ## Returns This function does not return any specific values. ## Examples ```c new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) { welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my server!"); PlayerTextDrawSetOutline(playerid, welcomeText[playerid], 1); PlayerTextDrawShow(playerid, welcomeText[playerid]); return 1; } ``` ## Related Functions - [CreatePlayerTextDraw](CreatePlayerTextDraw): Create a player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Destroy a player-textdraw. - [PlayerTextDrawGetOutline](PlayerTextDrawGetOutline): Get the outline size on a player-textdraw. - [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). - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Set the shadow on a player-textdraw. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Scale the text spacing in a player-textdraw to a proportional ratio. - [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.
openmultiplayer/web/docs/scripting/functions/PlayerTextDrawSetOutline.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/PlayerTextDrawSetOutline.md", "repo_id": "openmultiplayer", "token_count": 831 }
302
--- title: RemovePlayerAttachedObject description: Remove an attached object from a player. tags: ["player", "object", "attachment"] --- ## Description Remove an attached object from a player. | Name | Description | | -------- | ------------------------------------------------------------------------------------------------ | | playerid | The ID of the player to remove the object from. | | index | The index of the object to remove (set with [SetPlayerAttachedObject](SetPlayerAttachedObject)). | ## Returns **1** on success, **0** on failure. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strmp(cmdtext, "/remove", true)) // Remove Attached Objects { for (new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++) { if (IsPlayerAttachedObjectSlotUsed(playerid, i)) { RemovePlayerAttachedObject(playerid, i); } } return 1; } return 0; } ``` ## Related Functions - [SetPlayerAttachedObject](SetPlayerAttachedObject): Attach an object to a player - [IsPlayerAttachedObjectSlotUsed](IsPlayerAttachedObjectSlotUsed): Check whether an object is attached to a player in a specified index
openmultiplayer/web/docs/scripting/functions/RemovePlayerAttachedObject.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/RemovePlayerAttachedObject.md", "repo_id": "openmultiplayer", "token_count": 539 }
303
--- title: SendClientMessageToAll description: Displays a message in chat to all players. tags: [] --- ## Description Displays a message in chat to all players. This is a multi-player equivalent of [SendClientMessage](SendClientMessage). | Name | Description | | ---------------- | ------------------------------------------------- | | colour | The color of the message (0xRRGGBBAA Hex format). | | const format[] | The message to show (max 144 characters). | | OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | ## Returns This function always returns **true (1)**. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/helloworld", true) == 0) { // Send a message to everyone. SendClientMessageToAll(-1, "Hello!"); return 1; } if (strcmp(cmdtext, "/time", true) == 0) { new hours, minutes, seconds; gettime(hours, minutes, seconds); // Send current time message to everyone. SendClientMessageToAll(-1, "Current time is %02d:%02d:%02d", hours, minutes, seconds); return 1; } return 0; } ``` ## Notes :::warning Avoid using format specifiers in your messages without formatting the string that is sent. It will result in crashes otherwise. ::: ## Related Functions - [SendClientMessage](SendClientMessage): Send a message to a certain player. - [SendPlayerMessageToAll](SendPlayerMessageToAll): Force a player to send text for all players.
openmultiplayer/web/docs/scripting/functions/SendClientMessageToAll.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SendClientMessageToAll.md", "repo_id": "openmultiplayer", "token_count": 596 }
304
--- title: SetActorSkin description: Set the skin of the actor. tags: ["actor"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Set the skin of the actor. | Name | Description | |---------|---------------------------------| | actorid | The ID of the actor to set. | | skin | The ID of the skin to give them | ## Returns **true** - Success. **false** - Failure (i.e. Actor is not created/valid). ## Examples ```c new gMyActor; public OnGameModeInit() { gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000); SetActorSkin(gMyActor, 270); // Change actor skin from 179 to 270 return 1; } ``` ## Related Functions - [CreateActor](CreateActor): Create an actor (static NPC). - [GetActorSkin](GetActorSkin): Get the skin of the actor.
openmultiplayer/web/docs/scripting/functions/SetActorSkin.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetActorSkin.md", "repo_id": "openmultiplayer", "token_count": 294 }
305
--- title: SetObjectPos description: Change the position of an object. tags: ["object"] --- ## Description Change the position of an object. | Name | Description | | -------- | ---------------------------------------------------------------------- | | objectid | The ID of the object to set the position of. Returned by CreateObject. | | Float:x | The X coordinate to position the object at. | | Float:y | The Y coordinate to position the object at. | | Float:z | The Z coordinate to position the object at. | ## Returns This function always returns **true**, even if the object specified does not exist. ## Examples ```c SetObjectPos(objectid, 2001.195679, 1547.113892, 14.283400); ``` ## Related Functions - [CreateObject](CreateObject): Create an object. - [DestroyObject](DestroyObject): Destroy an object. - [IsValidObject](IsValidObject): Checks if a certain object is vaild. - [MoveObject](MoveObject): Move an object. - [StopObject](StopObject): Stop an object from moving. - [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. - [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](AttachPlayerObjectToPlayer): Attach a player object to a player.
openmultiplayer/web/docs/scripting/functions/SetObjectPos.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetObjectPos.md", "repo_id": "openmultiplayer", "token_count": 683 }
306
--- title: SetPlayerArmour description: Set a player's armor level. tags: ["player"] --- ## Description Set a player's armor level. | Name | Description | | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | | playerid | The ID of the player to set the armour of. | | Float:armour | The amount of armour to set, as a percentage (float). Values larger than 100 are valid, but won't be displayed in the HUD's armour bar. | ## Returns **1** - The function was executed successfully. **0** - The function failed to execute. This means the player specified does not exist. ## Examples ```c public OnPlayerSpawn(playerid) { // Give players full armour (100%) when they spawn. SetPlayerArmour(playerid, 100.0); return 1; } ``` ## Notes :::tip The function's name is armour, not armor (Americanized). This is inconsistent with the rest of SA-MP, so remember that. ::: :::warning Armour is obtained rounded to integers: set 50.15, but get 50.0 ::: ## Related Functions - [GetPlayerArmour](GetPlayerArmour): Find out how much armour a player has. - [SetPlayerHealth](SetPlayerHealth): Set a player's health. - [GetPlayerHealth](GetPlayerHealth): Find out how much health a player has.
openmultiplayer/web/docs/scripting/functions/SetPlayerArmour.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerArmour.md", "repo_id": "openmultiplayer", "token_count": 580 }
307
--- title: SetPlayerName description: Sets the name of a player. tags: ["player"] --- ## Description Sets the name of a player. | Name | Description | | ------------ | ------------------------------------------------------------------------------------------------------------------------------ | | playerid | The ID of the player to set the name of. | | const name[] | The name to set. Must be 1-24 characters long and only contain valid characters (0-9, a-z, A-Z, [], (), \$ @ . \_ and = only). | ## Returns **1** The name was changed successfully **0** The player is not connected or the name is already in use **-1** The name can not be changed (it's less than 3 symbols, too long or has invalid characters) ## Examples ```c // Command simply sets the player's name to to "Superman" if possible, with no error checking or messages. if (strcmp(cmdtext, "/superman", true) == 0) { SetPlayerName(playerid, "Superman"); return 1; } // Command sets the players name to "Superman" if possible, informs the player of // any errors using a "switch" statement. if (strcmp(cmdtext, "/superman", true) == 0) { switch (SetPlayerName(playerid, "Superman")) { case -1: { SendClientMessage(playerid, 0xFF0000FF, "The name has invalid characters or it's out of length."); } case 0: { SendClientMessage(playerid, 0xFF0000FF, "Unable to change your name, someone else is known as 'Superman' already."); } case 1: { SendClientMessage(playerid, 0x00FF00FF, "You are now known as 'Superman'"); } } return 1; } ``` ## Notes :::warning - Changing the players' name to the same name but with different character cases (e.g. "John" to "JOHN") will not work. - If used in [OnPlayerConnect](../callbacks/OnPlayerConnect), the new name will not be shown for the connecting player. - Passing a null string as the new name will crash the server. (Fixed in open.mp) - Player names can be up to 24 characters when using this function, but when joining the server from the SA-MP server browser, players' names must be no more than 20 and less than 3 characters (the server will deny entry). This allows for 4 characters extra when using SetPlayerName. ::: ## Related Functions - [GetPlayerName](GetPlayerName): Get a player's name. - [IsValidNickName](IsValidNickName): Checks if a nick name is valid. - [AllowNickNameCharacter](AllowNickNameCharacter): Allows a character to be used in the nick name.
openmultiplayer/web/docs/scripting/functions/SetPlayerName.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerName.md", "repo_id": "openmultiplayer", "token_count": 998 }
308
--- title: SetPlayerShopName description: Loads or unloads an interior script for a player (for example the ammunation menu). tags: ["player"] --- ## Description Loads or unloads an interior script for a player (for example the ammunation menu). | Name | Description | | ---------------- | -------------------------------------------------------------------------------------- | | playerid | The ID of the player to load the interior script for. | | const shopname[] | The [shop script](../resources/shopnames) to load. Leave blank ("") to unload scripts. | ## Returns This function does not return any specific values. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/enter", cmdtext)) { SetPlayerInterior(playerid, 5); SetPlayerPos(playerid, 372.5565, -131.3607, 1001.4922); SetPlayerShopName(playerid, "FDPIZA"); SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to Pizza Stack!"); return 1; } return 0; } ``` ## Notes :::tip This function does not support casino scripts. ::: ## Related Functions - [DisableInteriorEnterExits](DisableInteriorEnterExits): Disable the yellow door markers. - [SetPlayerInterior](SetPlayerInterior): Set a player's interior. ## Related Resources - [Shop Names](../resources/shopnames)
openmultiplayer/web/docs/scripting/functions/SetPlayerShopName.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerShopName.md", "repo_id": "openmultiplayer", "token_count": 534 }
309
--- title: SetSpawnInfo description: This function can be used to change the spawn information of a specific player. tags: ["player"] --- ## Description This function can be used to change the spawn information of a specific player. It allows you to automatically set someone's spawn weapons, their team, skin and spawn position, normally used in case of minigames or automatic-spawn systems. This function is more crash-safe then using [SetPlayerSkin](SetPlayerSkin) in [OnPlayerSpawn](../callbacks/OnPlayerSpawn) and/or [OnPlayerRequestClass](../callbacks/OnPlayerRequestClass). | Name | Description | | -------------- | -------------------------------------------------------------------- | | playerid | The PlayerID of who you want to set the spawn information. | | team | The Team-ID of the chosen player. | | skin | The [skin](../resources/skins) which the player will spawn with. | | Float:spawnX | The X-coordinate of the player's spawn position. | | Float:spawnY | The Y-coordinate of the player's spawn position. | | Float:spawnZ | The Z-coordinate of the player's spawn position. | | Float:angle | The direction in which the player needs to be facing after spawning. | | WEAPON:weapon1 | The first spawn-weapon for the player. | | ammo1 | The amount of ammunition for the primary spawnweapon. | | WEAPON:weapon2 | The second spawn-weapon for the player. | | ammo2 | The amount of ammunition for the second spawnweapon. | | WEAPON:weapon3 | The third spawn-weapon for the player. | | ammo3 | The amount of ammunition for the third spawnweapon. | ## Returns This function does not return any specific values. ## Examples ```c public OnPlayerRequestClass(playerid, classid) { // This simple example demonstrates how to spawn every player automatically with // CJ's skin, which is number 0. The player will spawn in Las Venturas, with // 36 Sawnoff-Shotgun rounds and 150 Tec9 rounds. SetSpawnInfo(playerid, NO_TEAM, 0, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); } ``` ## Notes :::warning In case you don't need to set a team to the player, make sure that the "team" parameter is set to `NO_TEAM` (255). Team ID 0 in open.mp is a valid team while in SA-MP it is not (SA-MP bug). ::: ## Related Functions - [GetSpawnInfo](GetSpawnInfo): Return the current spawn data for a player, where they will spawn next. - [SetPlayerSkin](SetPlayerSkin): Set a player's skin. - [SetPlayerTeam](SetPlayerTeam): Set a player's team. - [SpawnPlayer](SpawnPlayer): Force a player to spawn. ## Related Resources - [Skin IDs](../resources/skins) - [Weapon IDs](../resources/weaponids)
openmultiplayer/web/docs/scripting/functions/SetSpawnInfo.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetSpawnInfo.md", "repo_id": "openmultiplayer", "token_count": 1122 }
310
--- title: SetVehicleRespawnDelay description: Set the respawn delay of a vehicle. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Set the respawn delay of a vehicle. ## Parameters | Name | Description | |--------------|----------------------------------------| | vehicleid | The ID of the vehicle. | | respawnDelay | The respawn delay (in seconds) to set. | ## Examples ```c public OnGameModeInit() { new vehicleid = CreateVehicle(560, 2096.1917, -1328.5150, 25.1059, 0.0000, 1, 8, 60); SetVehicleRespawnDelay(vehicleid, 120); return 1; } ``` ## Related Functions - [GetVehicleRespawnDelay](GetVehicleRespawnDelay): Get the respawn delay of a vehicle.
openmultiplayer/web/docs/scripting/functions/SetVehicleRespawnDelay.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetVehicleRespawnDelay.md", "repo_id": "openmultiplayer", "token_count": 290 }
311
--- title: ShowVehicle description: Shows the hidden vehicle. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> :::warning This function has not yet been implemented. ::: ## Description Shows the hidden vehicle. ## Parametes | Name | Description | |-----------|--------------------------------| | vehicleid | The ID of the vehicle to show. | ## Examples ```c new g_Vehicle; public OnGameModeInit() { g_Vehicle = CreateVehicle(536, 2496.5034, 5.6658, 27.2247, 180.0000, -1, -1, 60); HideVehicle(g_Vehicle); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/showvehicle", true)) { if (IsVehicleHidden(g_Vehicle)) { ShowVehicle(g_Vehicle); } return 1; } return 0; } ``` ## Related Functions - [HideVehicle](HideVehicle): Hides a vehicle from the game. - [IsVehicleHidden](IsVehicleHidden): Checks if a vehicle is hidden.
openmultiplayer/web/docs/scripting/functions/ShowVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/ShowVehicle.md", "repo_id": "openmultiplayer", "token_count": 397 }
312
--- title: TextDrawGetPreviewRot description: Gets the rotation and zoom of a 3D model preview textdraw. tags: ["textdraw"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Gets the rotation and zoom of a 3D model preview textdraw. | Name | Description | | ---------------- | ------------------------------------------------------------------------------- | | Text:textid | The ID of the textdraw to get rotation and zoom of. | | &Float:rotationX | A float variable into which to store rotationX coordinate, passed by reference. | | &Float:rotationY | A float variable into which to store rotationY coordinate, passed by reference. | | &Float:rotationZ | A float variable into which to store rotationZ coordinate, passed by reference. | | &Float:zoom | A float variable into which to store zoom value, passed by reference. | ## Examples ```c new Text:gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); TextDrawUseBox(gMyTextdraw, true); TextDrawBoxColor(gMyTextdraw, 0x000000FF); TextDrawTextSize(gMyTextdraw, 40.0, 40.0); TextDrawSetPreviewModel(gMyTextdraw, 411); TextDrawSetPreviewRot(gMyTextdraw, -10.0, 0.0, -20.0, 1.0); new Float:rotationX, Float:rotationY, Float:rotationZ, Float:zoom; TextDrawGetPreviewRot(gMyTextdraw, rotationX, rotationY, rotationZ, zoom); // rotationX = -10.0 // rotationY = 0.0 // rotationZ = -20.0 // zoom = 1.0 return 1; } ``` ## Related Functions - [TextDrawSetPreviewRot](TextDrawSetPreviewRot): Sets the rotation and zoom of a 3D model preview textdraw. - [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): Set rotation of a 3D player textdraw preview. - [TextDrawSetPreviewModel](TextDrawSetPreviewModel): Set the 3D preview model of a textdraw. - [TextDrawSetPreviewVehCol](TextDrawSetPreviewVehCol): Set the colours of a vehicle in a 3D textdraw preview. - [TextDrawFont](TextDrawFont): Set the font of a textdraw. ## Related Callbacks - [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): Called when a player clicks on a textdraw.
openmultiplayer/web/docs/scripting/functions/TextDrawGetPreviewRot.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TextDrawGetPreviewRot.md", "repo_id": "openmultiplayer", "token_count": 814 }
313
--- title: TextDrawSetPreviewVehCol description: If a vehicle model is used in a 3D preview textdraw, this sets the two colour values for that vehicle. tags: ["textdraw"] --- ## Description If a vehicle model is used in a 3D preview textdraw, this sets the two colour values for that vehicle. | Name | Description | | ----------- | ------------------------------------------------------------------ | | Text:textid | The textdraw id that is set to display a 3D vehicle model preview. | | colour1 | The primary Color ID to set the vehicle to. | | colour2 | The secondary Color ID to set the vehicle to. | ## Returns This function does not return any specific values. ## Examples ```c new Text:gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); TextDrawUseBox(gMyTextdraw, true); TextDrawBoxColor(gMyTextdraw, 0x000000FF); TextDrawTextSize(gMyTextdraw, 40.0, 40.0); TextDrawSetPreviewModel(gMyTextdraw, 411); // Display model 411 (Infernus) TextDrawSetPreviewVehCol(gMyTextdraw, 6, 6); // Set the Infernus to have colour 6 (Yellow) // You still have to use TextDrawShowForAll/TextDrawShowForPlayer to make the textdraw visible. return 1; } ``` ## Notes :::warning The textdraw MUST use the font type `TEXT_DRAW_FONT_MODEL_PREVIEW` in order for this function to have effect. ::: ## Related Functions - [TextDrawSetPreviewModel](TextDrawSetPreviewModel): Set the 3D preview model of a textdraw. - [TextDrawSetPreviewRot](TextDrawSetPreviewRot): Set rotation of a 3D textdraw preview. - [TextDrawFont](TextDrawFont): Set the font of a textdraw. ## Related Callbacks - [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): Called when a player clicks on a textdraw.
openmultiplayer/web/docs/scripting/functions/TextDrawSetPreviewVehCol.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TextDrawSetPreviewVehCol.md", "repo_id": "openmultiplayer", "token_count": 670 }
314
--- title: TogglePlayerSpectating description: Toggle whether a player is in spectator mode or not. tags: ["player"] --- ## Description Toggle whether a player is in spectator mode or not. While in spectator mode a player can spectate (watch) other players and vehicles. After using this function, either [PlayerSpectatePlayer](PlayerSpectatePlayer) or [PlayerSpectateVehicle](PlayerSpectateVehicle) needs to be used. | Name | Description | | ----------- | ------------------------------------------------- | | playerid | The ID of the player who should spectate | | bool:toggle | 'true' to enable spectating and 'false to disable | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The player does not exist. ## Examples ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { TogglePlayerSpectating(playerid, true); PlayerSpectatePlayer(playerid, killerid); return 1; } ``` ## Notes :::tip When spectator mode is disabled, OnPlayerSpawn will automatically be called, if you wish to restore player to state before spectating, you will have to handle that in OnPlayerSpawn. Note also, that player can also go to class selection before if they used F4 during spectate, a player also CAN die in spectate mode due to various glitches. ::: :::tip When a player is in spectate mode their HUD is hidden, making it useful for setting a player's camera without the HUD. Also, objects near the player's camera will be streamed in, making this useful for interpolating cameras. ::: :::warning If the player is not loaded in before setting the spectate status to false, the connection can be closed unexpectedly. ::: ## Related Functions - [PlayerSpectatePlayer](PlayerSpectatePlayer): Spectate a player. - [PlayerSpectateVehicle](PlayerSpectateVehicle): Spectate a vehicle.
openmultiplayer/web/docs/scripting/functions/TogglePlayerSpectating.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TogglePlayerSpectating.md", "repo_id": "openmultiplayer", "token_count": 535 }
315
--- title: argstr description: Get the string value of an argument by name. tags: ["arguments", "args"] --- ## Description Get the string value of an argument by name. | Name | Description | | --------------------- | ----------------------------------------------------------------- | | skip = 0 | The number of arguments (with potentially the same name) to skip. | | const argument[] = "" | The name of the argument, including `-`s and `/`s. | | value[] = "" | The output string destination. | | size = sizeof (value) | The size of the destination. | | bool:pack = false | Should the return value be packed? | ## Returns **true** - the argument was found, **false** - it wasn't. ## Related Functions - [argcount](argcount): Get the number of arguments passed to the script (those after --). - [argindex](argindex): Get the name of the argument at the given index after --. - [argvalue](argvalue): Get the number of arguments passed to the script (those after --).
openmultiplayer/web/docs/scripting/functions/argstr.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/argstr.md", "repo_id": "openmultiplayer", "token_count": 467 }
316
--- title: fcopy description: Copy a file. tags: ["file management"] --- <VersionWarn version='omp v1.1.0.2612' /> <LowercaseNote /> ## Description Copy a file. | Name | Description | | -------------- | --------------------------------------------------------------------------------- | | const source[] | The name of the (existing) file that must be copied, optionally including a path. | | const target[] | The name of the new file, optionally including a full path. | ## Returns **true** on success, **false** on failure. ## Examples ```c if (fcopy("example.txt", "file.txt")) { // Success printf("The file \"example.txt\" copied to \"file.txt\" successfully."); } else { // Error print("The file \"example.txt\" does not exists, or can't be opened."); } ``` ## Notes :::warning If the target file already exists, it is overwritten. ::: ## 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. - [frename](frename): Rename 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/fcopy.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/fcopy.md", "repo_id": "openmultiplayer", "token_count": 724 }
317
--- title: floatpower description: Raises the given value to the power of the exponent. tags: ["math", "floating-point"] --- <LowercaseNote /> ## Description Raises the given value to the power of the exponent. | Name | Description | | -------------- | ------------------------------------------------------------------------- | | Float:value | The value to raise to a power, as a floating-point number. | | Float:exponent | The exponent is also a floating-point number. It may be zero or negative. | ## Returns The result of 'value' to the power of 'exponent'. ## Examples ```c printf("2 to the power of 8 is %.1f", floatpower(2.0, 8.0)); // Result: 256.0 ``` ## Related Functions - [floatsqroot](floatsqroot): Calculate the square root of a floating point value. - [floatlog](floatlog): Get the logarithm of the float value.
openmultiplayer/web/docs/scripting/functions/floatpower.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/floatpower.md", "repo_id": "openmultiplayer", "token_count": 328 }
318
--- title: ftell description: Get the current position in the file. tags: ["file management"] --- <VersionWarn version='omp v1.1.0.2612' /> <LowercaseNote /> ## Description Get the current position in the file. | Name | Description | | ----------- | -------------------------------------------- | | File:handle | The handle of the file. (returned by fopen). | ## Returns The current position, relative to the start of the file. ## Examples ```c // Open "file.txt" in "read only" mode new File:handle = fopen("file.txt", io_read); // Check, if the file is opened if (handle) { // Success printf("Current position: %d", ftell(handle)); // Close the file fclose(handle); } else { // Error print("The file \"file.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. - [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/ftell.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/ftell.md", "repo_id": "openmultiplayer", "token_count": 655 }
319
--- title: numargs description: Get the number of arguments passed to a function. tags: ["core", "arguments", "args"] --- <LowercaseNote /> ## Description Get the number of arguments passed to a function. ## Examples ```c SomeFunction(...) { printf("numargs(): %i", numargs()); } public OnFilterScriptInit() { SomeFunction(1, 2, 3); } // Output: "numargs(): 3" // Because 3 parameters (1, 2, 3) were passed. ``` ## Related Functions - [getarg](getarg): Retrieve an argument from a variable argument list. - [setarg](setarg): Set an argument.
openmultiplayer/web/docs/scripting/functions/numargs.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/numargs.md", "repo_id": "openmultiplayer", "token_count": 183 }
320
--- title: strfloat description: Converts a string to a float. tags: ["string", "floating-point"] --- <VersionWarn version='omp v1.1.0.2612' /> <LowercaseNote /> ## Description Converts a string to a float. | Name | Description | | -------------- | ----------------------------------- | | const string[] | The string to convert into a float. | ## Returns The requested float value. ## Examples ```c new string[4] = "6.9"; // A STRING holding a FLOAT. new Float:value = strfloat(string); SetPlayerPos(playerid, 0.0, 0.0, value); ``` ## Notes :::tip This function is the same as [floatstr](floatstr). ::: ## Related Functions - [floatround](floatround): Convert a float to an integer (rounding). - [float](float): Convert an integer to a float.
openmultiplayer/web/docs/scripting/functions/strfloat.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/strfloat.md", "repo_id": "openmultiplayer", "token_count": 280 }
321
--- title: "Keywords: Operators" --- ## `char` char returns the number of cells required to hold the given number of characters in a packed string. I.e. the number of 4-byte cells required to hold a given number of bytes. For example: ```c 4 char ``` Returns 1. ```c 3 char ``` Returns 1 (you can't have 3/4 of a variable). ```c 256 char ``` Returns 64 (256 divided by 4). This is generally used in variable declarations. ```c new someVar[40 char]; ``` Will make an array 10 cells big. For more information on packed strings read pawn-lang.pdf. ## `defined` Checks if a symbol exists. Generally used in #if statements: ```c new someVar = 5; #if defined someVar printf("%d", someVar); #else #error The variable 'someVar' isn't defined #endif ``` Most commonly it's used to check if a define is defined and generate code accordingly: ```c #define FILTERSCRIPT #if defined FILTERSCRIPT public OnFilterScriptInit() { return 1; } #else public OnGameModeInit() { return 1; } #endif ``` ## `sizeof` Returns the size in ELEMENTS of an array: ```c new someVar[10]; printf("%d", sizeof (someVar)); ``` Output: ```c 10 ``` And: ```c new someVar[2][10]; printf("%d %d", sizeof (someVar), sizeof (someVar[])); ``` Gives: ```c 2 10 ``` ## `state` This again is related to the PAWN autonoma code and thus not covered here. ## `tagof` This returns a number representing the tag of a variable: ```c new someVar, Float:someFloat; printf("%d %d", tagof (someVar), tagof (someFloat)); ``` Gives: ```c -./,),(-*,( -1073741820 ``` Which is a slight bug but basically means: ```c 0x80000000 0xC0000004 ``` To check, for example, if a variable is a float (with the tag 'Float:'): ```c new Float: fValue = 6.9; new tag = tagof (fValue); if (tag == tagof (Float:)) { print("float"); } else { print("not a float"); } ```
openmultiplayer/web/docs/scripting/language/Operators.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/language/Operators.md", "repo_id": "openmultiplayer", "token_count": 717 }
322
# Pitfalls: differences from C --- - PAWN lacks the typing mechanism of C. PAWN is an “integer-only” variety of C; there are no structures or unions, and floating point support must be implemented with user-defined operators and the help of native functions. - The accepted syntax for rational numbers is stricter than that of floating point values in C. Values like “.5” and “6.” are acceptable in C, but in PAWN one must write “0.5” and “6.0” respectively. In C, the decimal period is optional if an exponent is included, so one can write “2E8”; PAWN does not accept the upper case “E” (use a lower case “e”) and it requires the decimal point: e.g. “2.0e8”. See page 98 for more information. - PAWN does not provide “pointers”. For the purpose of passing function arguments by reference, PAWN provides a “reference” argument, (page 71). The “placeholder” argument replaces some uses of the NULL pointer (page 75). - Numbers can have hexadecimal, decimal or binary radix. Octal radix is not supported. See “Constants” on page 98. Hexadecimal numbers must start with “0x” (a lower case “x”), the prefix “0X” is invalid. - Escape sequences (“\n”, “\t”, etc.) are the same, except for “\ddd” where “ddd” represent three decimal digits, instead of the octal digits that C/C++ uses. The backslash (“\”) may be replaced with another symbol; see #pragma ctrlchar on page 120 —notably, previous versions of PAWN used the caret (“^”) as the escape character. - Cases in a switch statement are not “fall through”. Only a single instruction may (and must) follow each case label. To execute multiple instructions, you must use a compound statement. The default clause of a switch statement must be the last clause of the switch statement. More on page 115. In C/C++, switch is a “conditional goto”, akin to Fortran’s calculated labels. In PAWN, switch is a structured “if”. - A break statement breaks out of loops only. In C/C⁺⁺, the break statement also ends a case in a switch statement. Switch statements are implemented differently in PAWN (see page 115). - PAWN supports “array assignment”, with the restriction that both arrays must have the same size. For example, if “a” and “b” are both arrays with 6 cells, the expression “a = b” is valid. Next to literal strings, PAWN also supports literal arrays, allowing the expression “a = {0,1,2,3,4,5}” (where “a” is an array variable with 6 elements). - _char_ is an operator, not a type. See page 110 and the tips on page 137. - _defined_ is an operator, not a preprocessor directive. The defined operator in PAWN operates on constants (with const and enum), global variables, local variables and functions. - The _sizeof_ operator returns the size of a variable in “elements”, not in “bytes”. An element may be a cell or a sub-array. See page 109 for details. - The empty instruction is an empty compound block, not a semicolon (page 112). This modification avoids a frequent error. - The compiler directives differ from C’s preprocessor commands. Notably, the #define directive is incompatible with that of C/C⁺⁺, and #ifdef and #ifndef are replaced by the more general #if directive (see “Directives” on page 117). To create numeric constants, see also page 101; to create string constants, see also page 93. - Text substitutions (preprocessor macros; see the #define directive) are not matched across lines. That is, the text that you want to match and replace with a #define macro must appear on a single line. The definition of a #define macro must also appear on a single line. - The direction for truncation for the operator “/” is always towards the smaller value, where -2 is smaller than -1. The “%” operator always gives a positive result, regardless of the signs of the operands. See page 104. - There is no unary “+” operator, which is a “no-operation” operator anyway. - Three of the bitwise operators have different precedence than in C. The precedence levels of the “&”, “^” and | operators is higher than the rela- tional operators (Dennis Ritchie explained that these operators got their low precedence levels in C because early C compilers did not yet have the logical “&&” and || operators, so the bitwise “&” and | were used instead). - The “extern” keyword does not exist in PAWN; the current implementation of the compiler has no “linking phase”. To create a program from several source files, add all source files the compilers command line, or create one main project script file that “#include’s” all other source files. The PAWN compiler can optimize out functions and global variables that you do not use. See pages 63 and 84 for details. - In most situations, forward declarations of functions (i.e., prototypes) are not necessary. PAWN is a two-pass compiler, it will see all functions on the first pass and use them in the second pass. User-defined operators must be declared before use, however. If provided, forward declarations must match exactly with the function def- inition, parameter names may not be omitted from the prototype or differ from the function definition. PAWN cares about parameter names in pro- totypes because of the “named parameters” feature. One uses prototypes to call forwardly declared functions. When doing so with named param- eters, the compiler must already know the names of the parameters (and their position in the parameter list). As a result, the parameter names in a prototype must be equal to the ones in the definition. --- [Go Back to Contents](00-Contents.md)
openmultiplayer/web/docs/scripting/language/reference/11-Pitfalls-differences-from-C.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/language/reference/11-Pitfalls-differences-from-C.md", "repo_id": "openmultiplayer", "token_count": 1475 }
323
--- title: Constants description: A list of all standard library constant definitions. tags: [] --- # a_samp ## Limits | Value | Constant | | ----------------- | --------------------- | | 24 | MAX_PLAYER_NAME | | 1000 | MAX_PLAYERS | | 2000 | MAX_VEHICLES | | 1000 | MAX_ACTORS | | 1000 | MAX_OBJECTS | | 1024 | MAX_GANG_ZONES | | Text:2048 | MAX_TEXT_DRAWS | | PlayerText:256 | MAX_PLAYER_TEXT_DRAWS | | Menu:128 | MAX_MENUS | | Text3D:1024 | MAX_3DTEXT_GLOBAL | | PlayerText3D:1024 | MAX_3DTEXT_PLAYER | | 4096 | MAX_PICKUPS | ## Invalid Constants | Value | Constant | | ------------------- | ------------------------ | | 255 | NO_TEAM | | 0xFFFF | INVALID_PLAYER_ID | | 0xFFFF | INVALID_VEHICLE_ID | | 0xFFFF | INVALID_ACTOR_ID | | 0xFFFF | INVALID_OBJECT_ID | | Menu:0xFF | INVALID_MENU | | Text:0xFFFF | INVALID_TEXT_DRAW | | PlayerText:0xFFFF | INVALID_PLAYER_TEXT_DRAW | | -1 | INVALID_GANG_ZONE | | Text3D:0xFFFF | INVALID_3DTEXT_ID | | PlayerText3D:0xFFFF | INVALID_PLAYER_3DTEXT_ID | ## Weapon Constants | Value | Weapon | Constant | | ----- | ------------------ | ----------------------- | | 0 | Fist | WEAPON_FIST | | 1 | Brass Knuckles | WEAPON_BRASSKNUCKLE | | 2 | Golf Club | WEAPON_GOLFCLUB | | 3 | Nite stick | WEAPON_NITESTICK | | 4 | Knife | WEAPON_KNIFE | | 5 | Baseball Bat | WEAPON_BAT | | 6 | Shovel | WEAPON_SHOVEL | | 7 | Pool Cue | WEAPON_POOLSTICK | | 8 | Katana | WEAPON_KATANA | | 9 | Chainsaw | WEAPON_CHAINSAW | | 10 | Dildo | WEAPON_DILDO | | 11 | Dildo | WEAPON_DILDO2 | | 12 | Vibrator | WEAPON_VIBRATOR | | 13 | Vibrator | WEAPON_VIBRATOR2 | | 14 | Flower | WEAPON_FLOWER | | 15 | Cane | WEAPON_CANE | | 16 | Grenade | WEAPON_GRENADE | | 17 | Teargas | WEAPON_TEARGAS | | 18 | Molotov Cocktail | WEAPON_MOLTOV | | 22 | Colt 45 | WEAPON_COLT45 | | 23 | Silenced Pistol | WEAPON_SILENCED | | 24 | Desert Eagle | WEAPON_DEAGLE | | 25 | Shotgun | WEAPON_SHOTGUN | | 26 | Sawn-off Shotgun | WEAPON_SAWEDOFF | | 27 | Combat Shotgun | WEAPON_SHOTGSPA | | 28 | UZI | WEAPON_UZI | | 29 | MP5 | WEAPON_MP5 | | 30 | AK-47 | WEAPON_AK47 | | 31 | M4 | WEAPON_M4 | | 32 | TEC9 | WEAPON_TEC9 | | 33 | Rifle | WEAPON_RIFLE | | 34 | Sniper Rifle | WEAPON_SNIPER | | 35 | Roocket Launcher | WEAPON_ROCKETLAUNCHER | | 36 | Heat Seeker | WEAPON_HEATSEEKER | | 37 | Flamethrower | WEAPON_FLAMETHROWER | | 38 | Minigun | WEAPON_MINIGUN | | 39 | Satchel Explosives | WEAPON_SATCHEL | | 40 | Bomb | WEAPON_BOMB | | 41 | Spray Can | WEAPON_SPRAYCAN | | 42 | Fire Extinguisher | WEAPON_FIREEXTINGUISHER | | 43 | Camera | WEAPON_CAMERA | | 46 | Parachute | WEAPON_PARACHUTE | | 49 | Vehicle | WEAPON_VEHICLE | | 53 | Drowned | WEAPON_DROWN | | 54 | Splat | WEAPON_COLLISION | ## Marker Modes | Value | Constant | | ----- | ------------------------------ | | 0 | PLAYER_MARKERS_MODE_OFF | | 1 | PLAYER_MARKERS_MODE_GLOBAL | | 2 | PLAYER_MARKERS_MODE_STREAMED | ## Keys | Value | Constant | | ------ | ------------------------------ | | 1 | KEY_ACTION | | 2 | KEY_CROUCH | | 4 | KEY_FIRE | | 8 | KEY_SPRINT | | 16 | KEY_SECONDARY_ATTACK | | 32 | KEY_JUMP | | 64 | KEY_LOOK_RIGHT | | 128 | KEY_HANDBRAKE | | 256 | KEY_LOOK_LEFT | | 512 | KEY_SUBMISSION | | 512 | KEY_LOOK_BEHIND | | 1024 | KEY_WALK | | 2048 | KEY_ANALOG_UP | | 4096 | KEY_ANALOG_DOWN | | 8192 | KEY_ANALOG_LEFT | | 16384 | KEY_ANALOG_RIGHT | | 65536 | KEY_YES | | 131072 | KEY_NO | | 262144 | KEY_CTRL_BACK | ## Dialog Styles | Value | Constant | | ----- | ------------------------------ | | 0 | DIALOG_STYLE_MSGBOX | | 1 | DIALOG_STYLE_INPUT | | 2 | DIALOG_STYLE_LIST | | 3 | DIALOG_STYLE_PASSWORD | | 4 | DIALOG_STYLE_TABLIST | | 5 | DIALOG_STYLE_TABLIST_HEADERS | ## TextDraw Fonts | Value | Constant | | ----- | ------------------------------ | | 0 | TEXT_DRAW_FONT_0 | | 1 | TEXT_DRAW_FONT_1 | | 2 | TEXT_DRAW_FONT_2 | | 3 | TEXT_DRAW_FONT_3 | | 4 | TEXT_DRAW_FONT_SPRITE_DRAW | | 5 | TEXT_DRAW_FONT_MODEL_PREVIEW | ## TextDraw Fonts (From open.mp) | Value | Constant | |-------|--------------------------------| | 0 | TEXT_DRAW_FONT_BECKETT_REGULAR | | 1 | TEXT_DRAW_FONT_AHARONI_BOLD | | 2 | TEXT_DRAW_FONT_BANK_GOTHIC | | 3 | TEXT_DRAW_FONT_PRICEDOWN | | 4 | TEXT_DRAW_FONT_SPRITE | | 5 | TEXT_DRAW_FONT_PREVIEW | ## SVar Enumeration | Value | Constant | | ----- | ------------------------------ | | 0 | SERVER_VARTYPE_NONE | | 1 | SERVER_VARTYPE_INT | | 2 | SERVER_VARTYPE_STRING | | 3 | SERVER_VARTYPE_FLOAT | ## Artwork / Net Models | Value | Constant | | ----- | ------------------------------ | | 0 | DOWNLOAD_REQUEST_EMPTY | | 1 | DOWNLOAD_REQUEST_MODEL_FILE | | 2 | DOWNLOAD_REQUEST_TEXTURE_FILE | ## Click Sources | Value | Constant | | ----- | ------------------------------ | | 0 | CLICK_SOURCE_SCOREBOARD | ## Edit Response Types | Value | Constant | | ----- | ------------------------------ | | 0 | EDIT_RESPONSE_CANCEL | | 1 | EDIT_RESPONSE_FINAL | | 2 | EDIT_RESPONSE_UPDATE | ## Select Object Types | Value | Constant | | ----- | ------------------------------ | | 1 | SELECT_OBJECT_GLOBAL_OBJECT | | 2 | SELECT_OBJECT_PLAYER_OBJECT | ## Bullet Hit Types | Value | Constant | | ----- | ------------------------------ | | 0 | BULLET_HIT_TYPE_NONE | | 1 | BULLET_HIT_TYPE_PLAYER | | 2 | BULLET_HIT_TYPE_VEHICLE | | 3 | BULLET_HIT_TYPE_OBJECT | | 4 | BULLET_HIT_TYPE_PLAYER_OBJECT | # a_players ## Limits | Value | Constant | | ----- | ------------------------------- | | 10 | MAX_PLAYER_ATTACHED_OBJECTS | | 144 | MAX_CHATBUBBLE_LENGTH | ## Special Actions | Value | Constant | | ----- | ------------------------------- | | 0 | SPECIAL_ACTION_NONE | | 1 | SPECIAL_ACTION_DUCK | | 2 | SPECIAL_ACTION_USEJETPACK | | 3 | SPECIAL_ACTION_ENTER_VEHICLE | | 4 | SPECIAL_ACTION_EXIT_VEHICLE | | 5 | SPECIAL_ACTION_DANCE1 | | 6 | SPECIAL_ACTION_DANCE2 | | 7 | SPECIAL_ACTION_DANCE3 | | 8 | SPECIAL_ACTION_DANCE4 | | 10 | SPECIAL_ACTION_HANDSUP | | 11 | SPECIAL_ACTION_USECELLPHONE | | 12 | SPECIAL_ACTION_SITTING | | 13 | SPECIAL_ACTION_STOPUSECELLPHONE | | 20 | SPECIAL_ACTION_DRINK_BEER | | 21 | SPECIAL_ACTION_SMOKE_CIGGY | | 22 | SPECIAL_ACTION_DRINK_WINE | | 23 | SPECIAL_ACTION_DRINK_SPRUNK | | 24 | SPECIAL_ACTION_CUFFED | | 25 | SPECIAL_ACTION_CARRY | | 68 | SPECIAL_ACTION_PISSING | ## Fighting Styles | Value | Constant | | ----- | ------------------------------- | | 0 | FIGHT_STYLE_NORMAL | | 1 | FIGHT_STYLE_BOXING | | 2 | FIGHT_STYLE_KUNGFU | | 3 | FIGHT_STYLE_KNEEHEAD | | 4 | FIGHT_STYLE_GRABKICK | | 5 | FIGHT_STYLE_ELBOW | ## Weapon Skills | Value | Constant | | ----- | ------------------------------- | | 0 | WEAPONSKILL_PISTOL | | 1 | WEAPONSKILL_PISTOL_SILENCED | | 2 | WEAPONSKILL_DESERT_EAGLE | | 3 | WEAPONSKILL_SHOTGUN | | 4 | WEAPONSKILL_SAWNOFF_SHOTGUN | | 5 | WEAPONSKILL_SPAS12_SHOTGUN | | 6 | WEAPONSKILL_MICRO_UZI | | 7 | WEAPONSKILL_MP5 | | 8 | WEAPONSKILL_AK47 | | 9 | WEAPONSKILL_M4 | | 10 | WEAPONSKILL_SNIPERRIFLE | ## Weapon States | Value | Constant | | ----- | -------------------------- | | -1 | WEAPONSTATE_UNKNOWN | | 0 | WEAPONSTATE_NO_BULLETS | | 1 | WEAPONSTATE_LAST_BULLET | | 2 | WEAPONSTATE_MORE_BULLETS | | 3 | WEAPONSTATE_RELOADING | ## PVar Enumeration | Value | Constant | | ----- | -------------------------- | | 0 | PLAYER_VARTYPE_NONE | | 1 | PLAYER_VARTYPE_INT | | 2 | PLAYER_VARTYPE_STRING | | 3 | PLAYER_VARTYPE_FLOAT | ## Map Icon Styles | Value | Constant | | ----- | -------------------------- | | 0 | MAPICON_LOCAL | | 1 | MAPICON_GLOBAL | | 2 | MAPICON_LOCAL_CHECKPOINT | | 3 | MAPICON_GLOBAL_CHECKPOINT | ## Camera Cut Styles | Value | Constant | | ----- | -------------------------- | | 1 | CAMERA_MOVE | | 2 | CAMERA_CUT | ## Spectate Modes | Value | Constant | | ----- | -------------------------- | | 1 | SPECTATE_MODE_NORMAL | | 2 | SPECTATE_MODE_FIXED | | 3 | SPECTATE_MODE_SIDE | ## Recording for NPC playback | Value | Constant | | ----- | ------------------------------------ | | 1 | PLAYER_RECORDING_TYPE_NONE | | 2 | PLAYER_RECORDING_TYPE_DRIVER | | 3 | PLAYER_RECORDING_TYPE_ONFOOT | # a_vehicles ## Car Mod Type | Value | Constant | | ----- | ----------------------- | | 0 | CARMODTYPE_SPOILER | | 1 | CARMODTYPE_HOOD | | 2 | CARMODTYPE_ROOF | | 3 | CARMODTYPE_SIDESKIRT | | 4 | CARMODTYPE_LAMPS | | 5 | CARMODTYPE_NITRO | | 6 | CARMODTYPE_EXHAUST | | 7 | CARMODTYPE_WHEELS | | 8 | CARMODTYPE_STEREO | | 9 | CARMODTYPE_HYDRAULICS | | 10 | CARMODTYPE_FRONT_BUMPER | | 11 | CARMODTYPE_REAR_BUMPER | | 12 | CARMODTYPE_VENT_RIGHT | | 13 | CARMODTYPE_VENT_LEFT | ## Vehicle Params | Value | Constant | | ----- | ------------------------- | | 0 | VEHICLE_PARAMS_UNSET | | 1 | VEHICLE_PARAMS_OFF | | 2 | VEHICLE_PARAMS_ON | ## Vehicle Model Info | Value | Constant | | ----- | --------------------------------- | | 1 | VEHICLE_MODEL_INFO_SIZE | | 2 | VEHICLE_MODEL_INFO_FRONTSEAT | | 3 | VEHICLE_MODEL_INFO_REARSEAT | | 4 | VEHICLE_MODEL_INFO_PETROLCAP | | 5 | VEHICLE_MODEL_INFO_WHEELSFRONT | | 6 | VEHICLE_MODEL_INFO_WHEELSREAR | | 7 | VEHICLE_MODEL_INFO_WHEELSMID | | 8 | VEHICLE_MODEL_INFO_FRONT_BUMPER_Z | | 9 | VEHICLE_MODEL_INFO_REAR_BUMPER_Z | # a_objects ## Object Material Text Size | Value | Constant | | ----- | ---------------------------- | | 10 | OBJECT_MATERIAL_SIZE_32x32 | | 20 | OBJECT_MATERIAL_SIZE_64x32 | | 30 | OBJECT_MATERIAL_SIZE_64x64 | | 40 | OBJECT_MATERIAL_SIZE_128x32 | | 50 | OBJECT_MATERIAL_SIZE_128x64 | | 60 | OBJECT_MATERIAL_SIZE_128x128 | | 70 | OBJECT_MATERIAL_SIZE_256x32 | | 80 | OBJECT_MATERIAL_SIZE_256x64 | | 90 | OBJECT_MATERIAL_SIZE_256x128 | | 100 | OBJECT_MATERIAL_SIZE_256x256 | | 110 | OBJECT_MATERIAL_SIZE_512x64 | | 120 | OBJECT_MATERIAL_SIZE_512x128 | | 130 | OBJECT_MATERIAL_SIZE_512x256 | | 140 | OBJECT_MATERIAL_SIZE_512x512 | ## Object Material Text Alignmment | Value | Constant | | ----- | --------------------------------- | | 0 | OBJECT_MATERIAL_TEXT_ALIGN_LEFT | | 1 | OBJECT_MATERIAL_TEXT_ALIGN_CENTER | | 2 | OBJECT_MATERIAL_TEXT_ALIGN_RIGHT | # a_http | Value | Constant | | ----- | ----------------------------- | | 1 | HTTP_ERROR_BAD_HOST | | 2 | HTTP_ERROR_NO_SOCKET | | 3 | HTTP_ERROR_CANT_CONNECT | | 4 | HTTP_ERROR_CANT_WRITE | | 5 | HTTP_ERROR_CONTENT_TOO_BIG | | 6 | HTTP_ERROR_MALFORMED_RESPONSE |
openmultiplayer/web/docs/scripting/resources/constants.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/constants.md", "repo_id": "openmultiplayer", "token_count": 8125 }
324
--- title: HTTP Request Methods description: Types of HTTP request. --- :::note These request methods are used by [HTTP](../functions/HTTP) function. ::: | ID | Method | Description | |----|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 | HTTP_GET | Sends a regular HTTP request.<br />GET request is used to read/retrieve data from a web server. GET returns an HTTP status code of **200 (OK)** if the data is successfully retrieved from the server. | | 2 | HTTP_POST | Sends a HTTP request with POST data.<br />POST request is used to send data to the server. On successful creation, it returns an HTTP status code of **201**. | | 3 | HTTP_HEAD | Sends a regular HTTP request, but ignores any response data - returning only the response code.<br />HEAD method is used to request the response headers for a specific resource without receiving the actual content of the resource. |
openmultiplayer/web/docs/scripting/resources/http-request-methods.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/http-request-methods.md", "repo_id": "openmultiplayer", "token_count": 552 }
325
--- title: Weapon Skills description: Weapon skill values to be used with SetPlayerSkillLevel. --- ## Description The table below contains a list of valid weapon skill types used by [SetPlayerSkillLevel](../functions/SetPlayerSkillLevel) and [GetPlayerSkillLevel](../functions/GetPlayerSkillLevel). --- ## Skill Types | Value | Definition | |-------|-----------------------------| | 0 | WEAPONSKILL_PISTOL | | 1 | WEAPONSKILL_PISTOL_SILENCED | | 2 | WEAPONSKILL_DESERT_EAGLE | | 3 | WEAPONSKILL_SHOTGUN | | 4 | WEAPONSKILL_SAWNOFF_SHOTGUN | | 5 | WEAPONSKILL_SPAS12_SHOTGUN | | 6 | WEAPONSKILL_MICRO_UZI | | 7 | WEAPONSKILL_MP5 | | 8 | WEAPONSKILL_AK47 | | 9 | WEAPONSKILL_M4 | | 10 | WEAPONSKILL_SNIPERRIFLE | --- ## Skill Levels There are 3 weapon skill levels: Poor, Gangster and Hitman. The follow table shows the weapon skill levels needed to advance to the next skill level: | Weapon | Poor | Gangster | Hitman | | --------------- | ---- | -------- | ------ | | Pistol | 0 | 40 | 999 | | Slienced Pistol | 0 | 500 | 999 | | Desert Eagle | 0 | 200 | 999 | | Shotgun | 0 | 200 | 999 | | Sawnoff | 0 | 200 | 999 | | Combat | 0 | 200 | 999 | | Micro Uzi | 0 | 50 | 999 | | TEC-9 | 0 | 50 | 999 | | MP5 | 0 | 250 | 999 | | AK47 | 0 | 200 | 999 | | M4 | 0 | 200 | 999 | | Sniper Rifle | 0 | 300 | 999 | | Country Rifle | 0 | 300 | 999 |
openmultiplayer/web/docs/scripting/resources/weaponskills.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/weaponskills.md", "repo_id": "openmultiplayer", "token_count": 859 }
326
--- title: OnVehicleRespray description: يتم إستدعاء هذا الكالباك عند خروج اللاعب من مرآب تعديل السيارات حتى إذا كان طلاء السيارة لم يتغير tags: ["vehicle"] --- <div dir="rtl" style={{ textAlign: "right" }}> ## الوصف يتم إستدعاء هذا الكالباك عند خروج اللاعب من مرآب تعديل السيارات حتى إذا كان طلاء السيارة لم يتغير. إحذر الإسم غامض مرائب (إدفع و رش¹) لا يفعلوا هذا الكالباك | Name | Description | | --------- | ------------------------------------------------------------ | | playerid | إيدي اللاعب اللذي يقود السيارة | | vehicleid | إيدي السيارة التي تم إغادة طلائها | | color1 | اللون الذي تم تغيير اللون الأساسي للمركبة إليه | | color2 | اللون الذي تم تغيير اللون الثانوي للمركبة إليه | ## Returns يتم إستدعائه أولا في ال(الغيم مود²) إذا يرجع 0 و يقوم أيضا بتعطيل بقية الفيلترسكريبتات من رأيته ## أمثلة </div> ```c public OnVehicleRespray(playerid, vehicleid, color1, color2) { new string[48]; format(string, sizeof(string), "You resprayed vehicle %d to colors %d and %d!", vehicleid, color1, color2); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } ``` <div dir="rtl" style={{ textAlign: "right" }}> ## Notes :::tip هذا الكالب باك لا يتم إستدعائه من قبل (ChangeVehicleColor) بشكل مضلل. هذا الكالباك لا يتم إستدعائه من قبل (إدفع و رش¹) الإصلاح هنا: http://pastebin.com/G81da7N1 ::: :::warning الأخطاء المعروفة : معاينة أحد المكونات في مرآب التعديل قد يستدعي هذا الكال باك ::: ¹إدقع و رش = Pay 'n' Spray ²الغيم مود = gamemode ## الاستدعاءات او كالباكات ذات الصلة قد تكون الاستدعاءات التالية مفيدة، حيث أنها ذات صلة بهذا الاستدعاء بطريقة أو بأخرى - [OnVehiclePaintjob](OnVehiclePaintjob): هذا الكالباك يتم إستدعائه عندما يتم تغيير ستيكرات السيارة - [OnVehicleMod](OnVehicleMod): هذا الكالباك يتم إستدعائه عندما يتم تغيير مكونات السيارة - [OnEnterExitModShop](OnEnterExitModShop): هذا الكالباك يتم إستدعائه عند دخول أو خروج سيارة إلى مرآب التعديل ## وظائف ذات صلة قد تكون الوظائف التالية مفيدة، حيث أنها ذات صلة بهذا الاستدعاء بطريقة أو بأخرى - [ChangeVehicleColor](../functions/ChangeVehicleColor): يغير لون السيارة - [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob): يغير ستيكرات السيارة </div>
openmultiplayer/web/docs/translations/ar/scripting/callbacks/OnVehicleRespray.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ar/scripting/callbacks/OnVehicleRespray.md", "repo_id": "openmultiplayer", "token_count": 1680 }
327
--- title: OnDialogResponse description: Ovaj callback se poziva kada igrač odgovori na dijalog koji je pozvan ShowPlayerDialog funkcijom bilo klikom dugmeta, klikom ENTER/ESC tipke ili duplim klikom na list item (ukoliko koristite "list" style dijalog). tags: [] --- ## Deskripcija Ovaj callback se poziva kada igrač odgovori na dijalog koji je pozvan ShowPlayerDialog funkcijom bilo klikom dugmeta, klikom ENTER7ESC tipke ili duplim klikom na list item (ukoliko koristite list style dijalog). | Ime | Deskripcija | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------- | | playerid | ID igrača koji je odgovorio na dijalog. | | dialogid | ID dijaloga na koji je igrač odgovorio, dodijeljenog pozivanjem ShowPlayerDialog funkcije. | | response | 1 za lijevo i 0 za desno dugme (ako je samo jedno dugme prikazano, uvijek 1) | | listitem | ID list item-a koji je selektovan od strane igrača (počinje od 0) (samo ukoliko koristite list style dijalog, u suprotnom će biti -1). | | inputtext[] | Tekst upisan u input box od strane igrača text selektovanog list item-a. | ## Returns Uvijek je pozvana prva u filterskripti tako da return-ovanje 1 tu blokira ostale filterskripte da je vide. ## Primjeri ```c // Definiramo ID dijaloga kako bismo mogli upravljati odgovorima #define DIALOG_RULES 1 // U nekoj komandi pokazujemo taj dijalog ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Pravila Servera", "- Bez varanja i cheatovanja\n- Bez Spam-a\n- Postujte administraciju\n\nDa li se slazete sa pravilima?", "Da", "Ne"); public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_RULES) { if (response) // Ako su kliknuli 'Da' ili pritisnuli ENTER { SendClientMessage(playerid, COLOR_GREEN, "Hvala vam sto ste prihvatili pravila!"); } else // Ako su pritisnuli ESC ili kliknuli 'Ne' { Kick(playerid); } return 1; // Upravljali smo dijalogom zato dajemo return 1. Isto kao i u OnPlayerCommandText. } return 0; // MORAŠ dati return 0 ovdje! Kao i u OnPlayerCommandText. } // definiramo drugi dijalog, dajemo mu za jednu veću vrijednost od prošlog #define DIALOG_LOGIN 2 // U nekoj komandi pokazujemo taj dijalog ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Molimo unesite vasu lozinku:", "Login", "Odustani"); public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_LOGIN) { if (!response) // Ako su kliknuli 'Odustani' ili pritisnuli ESC { Kick(playerid); } else // Ako su pritisnuli ENTER ili kliknuli 'Login' { if (CheckPassword(playerid, inputtext)) { SendClientMessage(playerid, COLOR_RED, "Uspjesno si ulogovan!"); } else { SendClientMessage(playerid, COLOR_RED, "LOGIN FAILED."); // Ponovno prikazi dijalog igracu ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Molimo unesite vasu lozinku:", "Login", "Odustani"); } } return 1; // Upravljali smo dijalogom zato dajemo return 1. Isto kao i u OnPlayerCommandText. } return 0; // MORAŠ dati return 0 ovdje! Kao i u OnPlayerCommandText. } // definiramo treci dijalog, ponovno je vrijednost veca od vrijednosti proslog dijaloga #define DIALOG_WEAPONS 3 // U nekoj komandi pokazujemo taj dijalog ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Oruzja", "Desert Eagle\nAK-47\nCombat Shotgun", "Odaberi", "Zatvori"); public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_WEAPONS) { if (response) // Ako su pritisnuli 'Odaberi' ili dva puta pritisnuli na list item { // Daje im weapon switch(listitem) { case 0: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14); // Daje im desert eagle case 1: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Daje im AK-47 case 2: GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28); // Daje im a Combat Shotgun } } return 1; // Upravljali smo dijalogom zato dajemo return 1. Isto kao i u OnPlayerCommandText. } return 0; // MORAŠ dati return 0 ovdje! Kao i u OnPlayerCommandText. } // ovo je drugi nacin za prikaz i upravljanje za treci dijalog #define DIALOG_WEAPONS 3 // U nekoj komandi ga prikazujemo ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Oruzja", "Weapon\tAmmo\tPrice\n\ M4\t120\t500\n\ MP5\t90\t350\n\ AK-47\t120\t400", "Odaberi", "Zatvori"); public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_WEAPONS) { if (response) // Ako je pritisnuo 'Odaberi' ili dva puta pritisnuo na weapon { // Daje im weapon switch(listitem) { case 0: GivePlayerWeapon(playerid, WEAPON_M4, 120); // Daje im M4 case 1: GivePlayerWeapon(playerid, WEAPON_MP5, 90); // Daje im MP5 case 2: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Daje im AK-47 } } return 1; // Upravljali smo dijalogom zato dajemo return 1. Isto kao i u OnPlayerCommandText. } return 0; // MORAŠ dati return 0 ovdje! Kao i u OnPlayerCommandText. } ``` ## Zabilješke :::tip Parametri mogu sadržavati različite vrijednosti, bazirane na stilu dijaloga ([Klikni za više primjera](../resources/dialogstyles.md)). ::: :::tip Prikladno je prebaciti se kroz različite dijaloge, ako ih imate mnogo. ::: :::warning Dijalog igrača se ne sakriva kada se gamemode restartuje, uzrokujući to da server printa "Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID" (Prijevod: PlayerDialogResponse PlayerId: 0 ID dijaloga se ne poklapa sa IDem zadnje poslanog dijaloga) ako je igrač odgovorio na dijalog nakon restarta. ::: ## Srodne Funkcije - [ShowPlayerDialog](../functions/ShowPlayerDialog.md): Prikaži dijalog igraču.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnDialogResponse.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnDialogResponse.md", "repo_id": "openmultiplayer", "token_count": 3189 }
328
--- title: OnPlayerConnect description: Ovaj callback je pozvan kada se igrač konektovao na server. tags: ["player"] --- ## Deskripcija Ovaj callback je pozvan kada se igrač konektovao na server. | Ime | Deskripcija | | -------- | ----------------------------- | | playerid | ID igrača koji se konektovao. | ## Returns 1 - Spriječiti će da druge filterskripte primaju ovaj callback. 0 - Označava da će ovaj callback biti proslijeđen do sljedeće filterskripte. Uvijek je pozvana prva u filterskripti. ## Primjeri ```c public OnPlayerConnect(playerid) { new string[64], playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); format(string, sizeof string, "%s je usao na server. Dobrodosao!", playerName); SendClientMessageToAll(0xFFFFFFAA, string); return 1; } ``` ## Zabilješke :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerConnect.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerConnect.md", "repo_id": "openmultiplayer", "token_count": 392 }
329
--- title: OnPlayerLeaveRaceCheckpoint description: Ovaj callback se poziva kada igrač napusti race checkpoint. tags: ["player", "checkpoint", "racecheckpoint"] --- ## Deskripcija Ovaj callback se poziva kada igrač napusti race checkpoint. | Ime | Deskripcija | | -------- | ------------------------------------------- | | playerid | ID igrača koji je napustio race checkpoint. | ## Returns Uvijek je pozvana prva u filterskripti. ## Primjeri ```c public OnPlayerLeaveRaceCheckpoint(playerid) { printf("Igrač %d je napustio race checkpoint!", playerid); return 1; } ``` :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint.md): Kreira checkpoint za igrača. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint.md): Onemogući igračev trenutni checkpoint. - [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Provjeri da li je igrač u checkpointu. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint.md): Kreira race checkpoint za igrača. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint.md): Onemogući igračev trenutni race checkpoint. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Provjeri da li je igrač u race checkpointu.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 473 }
330
--- title: OnRconCommand description: Ovaj callback je pozvan kada je komanda poslana kroz server konzolu, upravljanjem RCON-om, ili kroz in-game "/rcon command". tags: [] --- ## Deskripcija Ovaj callback je pozvan kada je komanda poslana kroz server konzolu, upravljanjem RCON-om, ili kroz in-game "/rcon command". | Ime | Deskripcija | | ----- | ----------------------------------------------------------------------------- | | cmd[] | String koji sadrži komandu koja je upisana, kao i svi proslijeđeni parametri. | ## Returns Vijek je pozvan prvo u filterskriptama tako da će return-ovanje 0 ovdje blokirati gamemode da ga vidi. ## Primjeri ```c public OnRconCommand(cmd[]) { printf("[RCON]: napisao si '/rcon %s'!", cmd); return 0; } public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) { SendClientMessageToAll(0xFFFFFFAA, "Hello World!"); print("Rekao si hello world"); // Ovo će se pojaviti igraču koji je napisao tu rcon komandu u bijeloj boji return 1; } return 0; } ``` ## Zabilješke :::tip "/rcon " nije uključen/svrstan u "cmd" kada igrač napiše komandu. Ako koristite "print" funkciju ovdje, poslat će poruku igraču koji je upisao naredbu u igri, kao i log. Ovaj callback se ne poziva kada igrač nije prijavljen kao RCON administrator. Kada igrač nije prijavljen kao RCON admin i koristi / rcon prijavu, ovaj povratni poziv neće biti pozvan i umjesto toga će se pozvati OnRconLoginAttempt. Međutim, kada je igrač prijavljen kao RCON administrator, upotreba ove komande pozvat će ovaj callback. ::: :::warning Moraš da includeaš ovaj callbak u učitanu filterskrtipu kako bi radio u gamemode-u! ::: ## Srodne Funkcije - [IsPlayerAdmin](../functions/IsPlayerAdmin.md): Provjerava da li je igrač ulogovan u RCON. - [OnRconLoginAttempt](OnRconLoginAttempt.md): Pozvano kada se neko pokuša ulogovati na RCON.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnRconCommand.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnRconCommand.md", "repo_id": "openmultiplayer", "token_count": 854 }
331
--- title: AddPlayerClass description: Dodaje klasu na listu selekcije klasa. tags: ["player"] --- ## Deskripcija Dodaje klasu na listu selekcije klasa. Klase se koriste da se igrači spawnaju sa skinom njihovog odabira. | Ime | Deskripcija | | ------------- | ---------------------------------------------------------- | | modelid | Skin sa kojim će se igrač spawnovati/stvoriti. | | Float:spawn_x | X kordinata spawnpointa ove klase. | | Float:spawn_y | Y kordinata spawnpointa ove klase. | | Float:spawn_z | Z kordinata spawnpointa ove klase. | | Float:z_angle | Smjer u koji će igrač gledati nakon spawnovanja/stvaranja. | | weapon1 | Prvo spawn-oružje za igrača. | | weapon1_ammo | Količina municije za primarno spawn oružje. | | weapon2 | Drugo spawn-oružje za igrača. | | weapon2_ammo | Količina municije za sekundarno spawn oružje. | | weapon3 | Treće spawn-oružje za igrača. | | weapon3_ammo | Količina municije za treće spawn oružje. | ## Returns ID klase koja je upravo dodana. 319 ako je limit klasa (320) dostignut. Najveći mogući ID klase je 319. ## Primjeri ```c public OnGameModeInit() { // Igrači mogu da se spawnaju i sa CJ (0) ili Truth (1) skinom. AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth return 1; } ``` ## Zabilješke :::tip Najveći mogući ID klase je 319 (Počinje od 0, znači maksimalno 320 klasa). Kada je limit dostignut, sve naredne dodane klase će zamijeniti ID 319. ::: ## Srodne Funkcije - [AddPlayerClassEx](AddPlayerClassEx.md): Dodaj klasu sa zadanim timom. - [SetSpawnInfo](SetSpawnInfo.md): Postavi postavke za spawnovanje/stvaranje igrača. - [SetPlayerSkin](SetPlayerSkin.md): Postavi igračev skin/izgled.
openmultiplayer/web/docs/translations/bs/scripting/functions/AddPlayerClass.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/AddPlayerClass.md", "repo_id": "openmultiplayer", "token_count": 1072 }
332
--- title: AttachCameraToPlayerObject description: Prikvači kameru igrača za player objekat. tags: ["player"] --- ## Deskripcija Prikvači kameru igrača za player objekat. Igrač može pomicati svoju kameru dok je prikvačena za objekat. Može se koristiti s MovePlayerObject i AttachPlayerObjectToVehicle. | Ime | Deskripcija | | -------------- | ------------------------------------------------------------------------------ | | playerid | ID igrača koji će imati kameru prikvačenu za player-objekat. | | playerobjectid | ID player-objekta za kojeg želite prikvačiti kameru igrača. | ## Returns Ova funkcija ne returna(vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/attach", false)) { new playerobject = CreatePlayerObject(playerid, 1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0); AttachCameraToPlayerObject(playerid, playerobject); SendClientMessage(playerid, 0xFFFFFFAA, "Vasa kamera je zakacena na objekat."); return 1; } return 0; } ``` ## Zabilješke :::tip Prvo morate stvoriti player-objekt, prije nego što pokušate za to prikvačiti kameru igrača. ::: ## Related Functions - [AttachCameraToObject](AttachCameraToObject): Attachs the player's camera on an global object. - [SetPlayerCameraPos](SetPlayerCameraPos): Set a player's camera position. - [SetPlayerCameraLookAt](SetPlayerCameraLookAt): Set where a player's camera should face.
openmultiplayer/web/docs/translations/bs/scripting/functions/AttachCameraToPlayerObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/AttachCameraToPlayerObject.md", "repo_id": "openmultiplayer", "token_count": 681 }
333
--- title: ClearActorAnimations description: Uklanja bilo koju animaciju koja je postavljena aktoru. tags: [] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Uklanja bilo koju animaciju koja je postavljena aktoru. | Ime | Deskripcija | | ------- | -------------------------------------------------------------------------- | | actorid | ID aktora (vraćeno od CreateActor) kojem se uklanjaju animacije | ## Returns 1: Funkcija je uspješno izvršena. 0: Funkcija nije uspješno izvršena. Aktor ne postoji. ## Primjeri ```c new gMyActor; public OnGameModeInit() { gMyActor = CreateActor(...); } // negdje drugo ApplyActorAnimation(gMyActor, ...); // negdje drugo ClearActorAnimations(gMyActor); ``` ## Srodne Funkcije - [ApplyActorAnimation](ApplyActorAnimation): Postavlja animaciju aktoru.
openmultiplayer/web/docs/translations/bs/scripting/functions/ClearActorAnimations.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ClearActorAnimations.md", "repo_id": "openmultiplayer", "token_count": 410 }
334
--- title: DeletePlayer3DTextLabel description: Uništi 3D text label koji je kreiran koristeći CreatePlayer3DTextLabel. tags: ["player", "3dtextlabel"] --- ## Deskripcija Uništi 3D text label koji je kreiran koristeći CreatePlayer3DTextLabel. | Ime | Deskripcija | | --------------- | --------------------------------------- | | playerid | ID igrača čiji se 3D text label briše. | | PlayerText3D:textid | ID igračevog 3D text labela za brisati. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da spomenuti label ne postoji. ## Primjeri ```c new PlayerText3D:labelid = CreatePlayer3DTextLabel(...); // Later... DeletePlayer3DTextLabel(playerid, labelid); ``` ## Srodne Funkcije - [Create3DTextLabel](Create3DTextLabel): Kreiraj 3D text label. - [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): Prikvači 3D text label za igrača. - [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Prikvači 3D text label za vozilo. - [Update3DTextLabelText](Update3DTextLabelText): Promijeni tekst 3D text labela. - [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Kreiraj 3D text label za jednog igrača. - [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): Promijeni tekst igračevog 3D text labela.
openmultiplayer/web/docs/translations/bs/scripting/functions/DeletePlayer3DTextLabel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/DeletePlayer3DTextLabel.md", "repo_id": "openmultiplayer", "token_count": 519 }
335
--- title: EditAttachedObject description: Pristupi modu uređivanja za prikvačeni objekat. tags: [] --- ## Deskripcija Pristupi modu uređivanja za prikvačeni objekat. | Ime | Deskripcija | | -------- | ------------------------------------------------ | | playerid | ID igrača koji ulazi u mod uređivanja. | | index | Indeks (slot) prikvačenog objekta za uređivanje. | ## Returns 1 uspješno i 0 neuspješno. ## Primjeri ```c public OnPlayerSpawn(playerid) { SetPlayerAttachedObject(playerid, 0, 1337, 2); } public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/edit", true)) { EditAttachedObject(playerid, 0); SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Sada uređujete priloženi objekt na indeksu slot 0!"); return 1; } return 0; } ``` ## Zabilješke :::tip Kameru možete pomicati tijekom uređivanja pritiskom i držanjem razmaknice (ili W u vozilu) i pomicanjem miša. ::: :::warning Igrači će moći skalirati objekte do vrlo velike ili negativne vrijednosti. Ograničenja treba uspostaviti pomoću OnPlayerEditAttachedObject za prekid uređivanja ili isjecanja vrijednosti skale. ::: ## Srodne Funkcije - [SetPlayerAttachedObject](SetPlayerAttachedObject): Prikvači objekat za igrača - [RemovePlayerAttachedObject](RemovePlayerAttachedObject): Ukloni prikvačeni objekat sa igrača - [IsPlayerAttachedObjectSlotUsed](IsPlayerAttachedObjectSlotUsed): Provjeri da li je objekat prikvačen za igrača u oređenom indexu. - [EditObject](EditObject): Uredi objekat. - [EditPlayerObject](EditPlayerObject): Uredi player objekat. - [SelectObject](SelectObject): odaberi objekat. - [CancelEdit](CancelEdit): Prekini uređivanje objekta. - [OnPlayerEditAttachedObject](../callbacks/OnPlayerEditAttachedObject): Pozvano kada igrač dovrši uređivanje prikvačenog objekta.
openmultiplayer/web/docs/translations/bs/scripting/functions/EditAttachedObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/EditAttachedObject.md", "repo_id": "openmultiplayer", "token_count": 809 }
336
--- title: GangZoneDestroy description: Uništi gangzonu. tags: ["gangzone"] --- ## Deskripcija Uništi gangzonu. | Ime | Deskripcija | | ---- | -------------------- | | zone | ID zone za uništiti. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c new gangZoneId; gangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); GangZoneDestroy(gangZoneId); ``` ## Srodne Funkcije - [GangZoneCreate](GangZoneCreate): Kreiraj gangzonu. - [GangZoneShowForPlayer](GangZoneShowForPlayer): Prikaži gang zonu za igrača. - [GangZoneShowForAll](GangZoneShowForAll): Prikaži gang zonu za sve igrače. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Sakrij gangzonu za igrača. - [GangZoneHideForAll](GangZoneHideForAll): Sakrij gangzonu za sve igrače. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Kreiraj bljeskalicu gang zone za igrača. - [GangZoneFlashForAll](GangZoneFlashForAll): Kreiraj bljeskalicu gang zone za sve igrače. - [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Zaustavi gang zonu da bljeska za igrača. - [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Zaustavi gang zonu da bljeska za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/GangZoneDestroy.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GangZoneDestroy.md", "repo_id": "openmultiplayer", "token_count": 493 }
337
--- title: GetConsoleVarAsInt description: Dobij cjelobrojnu (integer) vrijednost varijable iz konzole. tags: [] --- ## Deskripcija Dobij cjelobrojnu (integer) vrijednost varijable iz konzole. | Ime | Deskripcija | | --------------- | ----------------------------------------------------- | | const varname[] | Ime integer varijable za dobijanje vrijednosti. | ## Returns Vrijednost navedene console varijable. 0 ako navedena console varijabla nije cijeli broj (integer) ili ne postoji. ## Primjeri ```c new serverPort = GetConsoleVarAsInt("port"); printf("Server Port: %i", serverPort); ``` ## Zabilješke :::tip Upišite 'varlist' u konzolu servera da biste prikazali listu dostupnih console varijabli i njihove tipove. ::: ## Srodne Funkcije - [GetConsoleVarAsString](GetConsoleVarAsString): Dobij string vrijednost varijable iz konzole. - [GetConsoleVarAsBool](GetConsoleVarAsBool): Dobij bool(ean) vrijednost varijable iz konzole.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetConsoleVarAsInt.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetConsoleVarAsInt.md", "repo_id": "openmultiplayer", "token_count": 420 }
338
--- title: GetPlayerSkin description: Vraća klasu skina igrača. tags: ["player"] --- ## Deskripcija Vraća klasu skina igrača. | Ime | Deskripcija | | -------- | --------------------------------- | | playerid | Igrač od kojeg želite dobiti skin | ## Returns ID skina (0 ako je nevažeći) ## Primjeri ```c playerskin = GetPlayerSkin(playerid); ``` ## Zabilješke :::tip Vraća novi skin nakon što se pozove SetSpawnInfo, ali prije nego što se igrač stvarno ponovo pokrene da bi dobio novi skin. Vraća stari skin ako je igrač stvoren putem funkcije SpawnPlayer. ::: ## Srodne Funkcije - [SetPlayerSkin](SetPlayerSkin): Postavi skin igraču.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerSkin.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerSkin.md", "repo_id": "openmultiplayer", "token_count": 293 }
339
--- title: GetPlayerWeaponData description: Dobij oružje i streljivo u određenom igračevom slotu oružja (npr. oružje u 'SMG' slotu). tags: ["player"] --- ## Deskripcija Dobij oružje i streljivo u određenom igračevom slotu oružja (npr. oružje u 'SMG' slotu). | Ime | Deskripcija | | -------- | ---------------------------------------------------------- | | playerid | ID igrača čije podatke o oružju treba dobiti. | | slot | Slot oružja za dobiti podatke (0-12). | | &weapons | Varijabla za pohraniti ID oružja, proslijeđeno referencom. | | &ammo | Varijabla za pohraniti streljivo, proslijeđeno referencom. | ## Returns 1: Funkcija uspješno izvršena.. 0: Funkcija neuspješno izvršena. Igrač nije povezan i/ili je navedeni slot za oružje nevažeći (važeće 0-12). ## Primjeri ```c // Uobičajena upotreba: nabavite sve oružje i pohranite podatke u niz koji sadrži 13 slotova // Prva vrijednost je ID oružja, a druga streljivo new weapons[13][2]; for (new i = 0; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); } ``` ## Zabilješke :::tip Staro oružje bez preostalog streljiva i dalje se vraća. ::: ## Srodne Funkcije - [GetPlayerWeapon](GetPlayerWeapon): Provjeri koje oružje igrač trenutno drži. - [GivePlayerWeapon](GivePlayerWeapon): Daj igraču oružje.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerWeaponData.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerWeaponData.md", "repo_id": "openmultiplayer", "token_count": 682 }
340
--- title: GetVehicleDistanceFromPoint description: Ova se funkcija može koristiti za izračunavanje udaljenosti (kao float) između vozila i druge kordinate na mapi. tags: ["vehicle"] --- ## Deskripcija Ova se funkcija može koristiti za izračunavanje udaljenosti (kao float) između vozila i druge kordinate na mapi. Ovo može biti korisno za provjeravanje koliko je vozilo daleko od lokacije. | Ime | Deskripcija | | --------- | ----------------------------------- | | vehicleid | ID vozila za izračunati udaljenost. | | Float:X | X kordinata na mapi. | | Float:Y | Y kordinata na mapi. | | Float:Z | Z kordinata na mapi. | ## Returns Float koji sadrži udaljenost od navedene tačke u kordinatama. ## Primjeri ```c /* kada igrač napiše 'vendingmachine' u chat box, vidjeti će ovo.*/ public OnPlayerText(playerid, text[]) { if (strcmp(text, "vendingmachine", true) == 0) { new Float: fDistance = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid), 237.9, 115.6, 1010.2), szMessage[44]; format(szMessage, sizeof(szMessage), "Ti si %f daleko od vending mašine.", fDistance); SendClientMessage(playerid, 0xA9C4E4FF, szMessage); } return 0; } ``` ## Srodne Funkcije - [GetPlayerDistanceFromPoint](GetPlayerDistanceFromPoint): Dobij razmak između igrača i tačke. - [GetVehiclePos](GetVehiclePos): Doznajte položaj vozila.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleDistanceFromPoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleDistanceFromPoint.md", "repo_id": "openmultiplayer", "token_count": 682 }
341
--- title: GivePlayerMoney description: Dajte novac igraču ili ga uzmite. tags: ["player"] --- ## Deskripcija Dajte novac igraču ili ga uzmite. | Ime | Deskripcija | | -------- | ---------------------------------------------------------------------------------------- | | playerid | ID igrača za dati ili oduzeti novac. | | money | Količina novca za dati igraču. Koristi minus vrijednost da mu uzmeš novac (npr. -10000). | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da igrač nije konektovan. ## Primjeri ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { if (killerid != INVALID_PLAYER_ID) { // Nagradi $1000 ubicu GivePlayerMoney(killerid, 1000); SendClientMessage(killerid, -1, "Nagrađen si sa $1000 za kill."); } // Uzmi $500 od igrača koji je umro. GivePlayerMoney(playerid, -500); } ``` ## Srodne Funkcije - [ResetPlayerMoney](ResetPlayerMoney): Postavite novac igrača na $0. - [GetPlayerMoney](GetPlayerMoney): Provjeri koliko novca igrač ima.
openmultiplayer/web/docs/translations/bs/scripting/functions/GivePlayerMoney.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GivePlayerMoney.md", "repo_id": "openmultiplayer", "token_count": 573 }
342
--- title: IsPlayerInRaceCheckpoint description: Provjerava ako je igrač unutar njihovog trenutno postavljenog race checkpointa/markera (SetPlayerRaceCheckpoint). tags: ["player", "checkpoint", "racecheckpoint"] --- ## Deskripcija Provjerava ako je igrač unutar njihovog trenutno postavljenog race checkpointa/markera (SetPlayerRaceCheckpoint). | Ime | Deskripcija | | -------- | ---------------------- | | playerid | ID igrača za provjeru. | ## Returns 0: Igrač nije u race checkpointu/markeru. 1: Igrač jeste u race checkpointu/markeru. ## Primjeri ```c if (IsPlayerInRaceCheckpoint(playerid)) { SetPlayerHealth(playerid, 100); } ``` ## Srodne Funkcije - [SetPlayerCheckpoint](SetPlayerCheckpoint): Kreiraj checkpoint za igrača. - [DisablePlayerCheckpoint](DisablePlayerCheckpoint): Onemogući igračev trenutni checkpoint. - [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. - [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): Pozvano kada igrač uđe u checkpoint. - [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): Pozvano kada igrač napusti checkpoint. - [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): Pozvano kada igrač uđe u race checkpoint. - [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): Pozvano kada igrač napusti race checkpoint.
openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerInRaceCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerInRaceCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 546 }
343
--- title: LimitGlobalChatRadius description: Postavite ograničenje radijusa za chat. tags: [] --- ## Deskripcija Postavite ograničenje radijusa za chat. Samo igrači na određenoj udaljenosti od igrača vidjet će svoju poruku u chatu. Takođe mijenja udaljenost na kojoj igrač može vidjeti druge igrače na mapi na istoj udaljenosti. | Ime | Deskripcija | | ----------------- | ------------------------------------------ | | Float:chat_radius | Opseg u kojem će igrači moći vidjeti chat. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnGameModeInit() { LimitGlobalChatRadius(200.0); return 1; } ``` ## Srodne Funkcije - [SetNameTagDrawDistance](SetNameTagDrawDistance): Postavite udaljenost od mjesta na kojem ljudi mogu vidjeti oznake imena drugih igrača. - [SendPlayerMessageToPlayer](SendPlayerMessageToPlayer): Prisilite igrača da pošalje tekst za jednog igrača. - [SendPlayerMessageToAll](SendPlayerMessageToAll): Prisilite igrača da pošalje tekst za sve igrače. - [OnPlayerText](../callbacks/OnPlayerText): Pozvano kada igrač pošalje poruku putem chata.
openmultiplayer/web/docs/translations/bs/scripting/functions/LimitGlobalChatRadius.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/LimitGlobalChatRadius.md", "repo_id": "openmultiplayer", "token_count": 500 }
344
--- title: PlayCrimeReportForPlayer description: Ova funkcija reproducira prijavu zločina za igrača - baš kao i kod jednog igrača kada CJ počini zločin. tags: ["player"] --- ## Deskripcija Ova funkcija reproducira prijavu zločina za igrača - baš kao i kod jednog igrača kada CJ počini zločin. | Ime | Deskripcija | | --------- | ---------------------------------------------------------------------------------------------------------------- | | playerid | ID igrača koji će čuti prijavu zločina (crime report).. | | suspectid | ID osumnjičeni igrač koji će biti opisan u krivičnoj prijavi. | | crimeid | [Crime ID](../resources/crimelist), koji će biti prijavljen kao 10-kod (tj. 10-16 ako je 16 donesen kao zločin). | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da navedeni igrač ne postoji. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/suspect")) { PlayCrimeReportForPlayer(playerid, 0, 16); SendClientMessage(playerid, 0xFFFFFFFF, "ID 0 je napravio zločin (10-16)."); return 1; } return 0; } ``` ## Srodne Funkcije - [PlayerPlaySound](PlayerPlaySound): Reprodukujte zvuk za igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/PlayCrimeReportForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayCrimeReportForPlayer.md", "repo_id": "openmultiplayer", "token_count": 713 }
345
--- title: PlayerTextDrawSetProportional description: Prilagođava razmak između teksta proporcionalnom omjeru. tags: ["player", "textdraw", "playertextdraw"] --- ## Deskripcija Prilagođava razmak između teksta proporcionalnom omjeru. Korisno pri korišćenju PlayerTextDrawLetterSize kako bi se osiguralo da tekst ima ravnomjeran razmak između karaktera. | Ime | Deskripcija | | -------- | ------------------------------------------------------------------ | | playerid | ID igrača čijem player-textdrawu treba postaviti proporcionalnost. | | text | ID player-textdrawa za postaviti proporcionalnost. | | set | 1 da omogućite proporcionalnost, 0 da onemogućite. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Srodne Funkcije - [CreatePlayerTextDraw](CreatePlayerTextDraw): Kreiraj player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Uništi player-textdraw. - [PlayerTextDrawColor](PlayerTextDrawColor): Postavi boju teksta u player-textdrawu. - [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): Postavi boju box-a od player-textdrawa. - [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): Postavi boju pozadine player-textdrawa. - [PlayerTextDrawAlignment](PlayerTextDrawAlignment): Postavi poravnanje player-textdrawa. - [PlayerTextDrawFont](PlayerTextDrawFont): Postavi font player-textdrawa. - [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): Postavi veličinu slova u tekstu player-textdrawa. - [PlayerTextDrawTextSize](PlayerTextDrawTextSize): Postavi veličinu box-a player-textdrawa (ili dijela koji reaguje na klik za PlayerTextDrawSetSelectable). - [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): Omogući/onemogući korišćenje outline-a za player-textdraw. - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Postavi sjenu na player-textdraw. - [PlayerTextDrawUseBox](PlayerTextDrawUseBox): Omogući/onemogući korišćenje box-a za player-textdraw. - [PlayerTextDrawSetString](PlayerTextDrawSetString): Postavi tekst player-textdrawa. - [PlayerTextDrawShow](PlayerTextDrawShow): Prikaži player-textdraw. - [PlayerTextDrawHide](PlayerTextDrawHide): Sakrij player-textdraw.
openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawSetProportional.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawSetProportional.md", "repo_id": "openmultiplayer", "token_count": 838 }
346
--- title: ResetPlayerWeapons description: Uklanja sva oružja od igrača. tags: ["player"] --- ## Deskripcija Uklanja sva oružja od igrača. | Ime | Deskripcija | | -------- | ---------------------------------------- | | playerid | ID igrača čija će oružja biti uklonjena. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da navedeni igrač ne postoji. ## Primjeri ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Ukloni oružja ubice ResetPlayerWeapons(killerid); return 1; } ``` ## Zabilješke :::tip Da biste uklonili pojedinačno oružje sa igrača, postavite njegovu municiju na 0 pomoću SetPlayerAmmo. ::: ## Srodne Funkcije - [GivePlayerWeapon](GivePlayerWeapon): Daj igraču oružje. - [GetPlayerWeapon](GetPlayerWeapon): Provjeri koje oružje igrač trenutno drži.
openmultiplayer/web/docs/translations/bs/scripting/functions/ResetPlayerWeapons.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ResetPlayerWeapons.md", "repo_id": "openmultiplayer", "token_count": 402 }
347
--- title: SetCameraBehindPlayer description: Vratite kameru na mjesto iza igrača nakon upotrebe funkcije poput SetPlayerCameraPos. tags: ["player"] --- ## Deskripcija Vratite kameru na mjesto iza igrača nakon upotrebe funkcije poput SetPlayerCameraPos. | Ime | Deskripcija | | -------- | ------------------------------------------------------ | | playerid | Igrač kojem želite vratiti kameru na mjesto iza njega. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da navedeni igrač ne postoji. ## Primjeri ```c SetCameraBehindPlayer(playerid); ``` ## Srodne Funkcije - [SetPlayerCameraPos](SetPlayerCameraPos): Postavi poziciju kamere igrača. - [SetPlayerCameraLookAt](SetPlayerCameraLookAt): Postavite gdje će igračeva kamera gledati.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetCameraBehindPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetCameraBehindPlayer.md", "repo_id": "openmultiplayer", "token_count": 349 }
348
--- title: SetPlayerAmmo description: Postavi streljivo igračevog oružja. tags: ["player"] --- ## Deskripcija Postavi streljivo igračevog oružja. | Ime | Deskripcija | | -------- | ---------------------------------------------------------------------- | | playerid | ID igrača za postaviti streljivo. | | weaponid | ID oružja za postaviti streljivo. (ne weaponslot kao u samp include-u) | | ammo | Količina streljiva za postaviti. | ## Returns 1: Funkcija uspješno izvršena. Uspješno je također vraćeno i kada je navedeni slot oružja nevažeći (nije 0-12). 0: Funkcija neuspješno izvršena. Igrač nije konektovan. ## Primjeri ```c SetPlayerAmmo(playerid, WEAPON_SHOTGUN, 100); // Postavi streljivo za Shotgun na 100 metaka ``` ## Zabilješke :::tip Parametar 'weaponslot' je greška u kucanju u sa-mp include-u. Morate koristiti ID oružja, a ne otvor za oružje za koji želite postaviti streljivo. ::: :::tip Postavite streljivo na 0 da biste uklonili oružje iz inventara igrača. Imajte na umu da će se oružje i dalje prikazivati ​​u GetPlayerWeaponData, iako sa 0 streljiva. ::: ## Srodne Funkcije - [GetPlayerAmmo](GetPlayerAmmo): Provjeri koliko streljiva igrač ima u određenom slotu. - [GivePlayerWeapon](GivePlayerWeapon): Daj igraču oružje. - [SetPlayerArmedWeapon](SetPlayerArmedWeapon): Postavite igračevo "armed" oružje.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerAmmo.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerAmmo.md", "repo_id": "openmultiplayer", "token_count": 715 }
349
--- title: SetPlayerMarkerForPlayer description: Promijeni boju igračevog nametag-a i bljeskalice na radaru za drugog igrača. tags: ["player"] --- ## Deskripcija Promijeni boju igračevog nametag-a i bljeskalice na radaru za drugog igrača. | Ime | Deskripcija | | ------------ | ---------------------------------------------------------------------------- | | playerid | Igrač koji će vidjeti promijenjenu boju bljeskalice/nametag-a drugog igrača. | | showplayerid | Igrač čija će boja biti promijenjena. | | color | Nova boja. Podržava alfa vrijednosti. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c // Postavi da igrač ID 42 vidi igrača ID 1 kao crveni marker (crvenu oznaku na mapi/radaru) SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF); // Neka igračeva oznaka/marker bude nevidljivo bijeli/a (chat će biti bijeli, ali marker više neće biti). SetPlayerMarkerForPlayer(42, 1, 0xFFFFFF00); // Neka oznaka/marker igrača bude nevidljiva igraču, a boja chata će ostati ista. Ispravno će raditi samo ako je korišten SetPlayerColor: SetPlayerMarkerForPlayer(42, 1, (GetPlayerColor(1) & 0xFFFFFF00)); // Neka oznaka/marker igrača bude potpuno neproziran (pun) za igrača, a da boja chata ostane ista. Ispravno će raditi samo ako je korišten SetPlayerColor: SetPlayerMarkerForPlayer(42, 1, (GetPlayerColor(1) | 0x000000FF)); ``` ## Srodne Funkcije - [ShowPlayerMarkers](ShowPlayerMarkers): Odlučite hoće li server prikazivati ​​oznake na radaru. - [LimitPlayerMarkerRadius](LimitPlayerMarkerRadius): Ograničite radijus markera/oznake igrača. - [SetPlayerColor](SetPlayerColor): Postavi boju igrača. - [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): Prikaži ili sakrij nametag za određenog igrača. - [GetPlayerMarkerForPlayer](GetPlayerMarkerForPlayer): Dobiva igračev marker za određenog igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerMarkerForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerMarkerForPlayer.md", "repo_id": "openmultiplayer", "token_count": 914 }
350
--- title: SetPlayerTeam description: Postavi tim igrača. tags: ["player"] --- ## Deskripcija Postavi tim igrača. | Ime | Deskripcija | | -------- | ----------------------------------------------------------------------------- | | playerid | ID igrača kojem želite postaviti tim. | | teamid | Tim za ubaciti igrača. Koristi NO_TEAM da uklonite igrača iz bilo kojeg tima. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerSpawn(playerid) { // Postavi tim 4 igraču kada se spawnuje SetPlayerTeam(playerid, 4); return 1; } ``` ## Zabilješke :::tip Igrači ne mogu oštetiti / ubiti igrače iz istog tima, osim ako nožem ne prerežu grkljan. Od SA-MP 0.3x, igrači takođe ne mogu oštetiti vozila koja vozi igrač iz istog tima. To se može omogućiti pomoću EnableVehicleFriendlyFire. 255 (ili NO_TEAM) je zadani tim koji može pucati na druge igrače, a ne na 0. ::: ## Srodne Funkcije - [GetPlayerTeam](GetPlayerTeam): Provjerite u kojem je igrač timu. - [SetTeamCount](SetTeamCount): Postavi broj dostupnih timova. - [EnableVehicleFriendlyFire](EnableVehicleFriendlyFire): Omogućite prijateljsku vatru za timska vozila.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerTeam.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerTeam.md", "repo_id": "openmultiplayer", "token_count": 605 }
351
--- title: SetVehicleNumberPlate description: Postavite registarsku tablicu vozila. tags: ["vehicle"] --- ## Deskripcija Postavite registarsku tablicu vozila. | Ime | Deskripcija | | ----------- | ---------------------------------------------------- | | vehicleid | ID vozila za postaviti registarsku tablicu. | | numberplate | Tekst koji će biti prikazan na registarskoj tablici. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Vozilo ne postoji. ## Primjeri ```c new vehicleid = CreateVehicle(542, 2074.73, 1089.89, 10.51, 0.0, -1, -1, -1); SetVehicleNumberPlate(vehicleid, "ABCD 123"); ``` ## Zabilješke :::tip Ova funkcija nema internu provjeru grešaka. Ne dodjeljujte prilagođene registarske tablice vozilima bez tablica (čamci, avioni, itd.) Jer će to rezultirati nekim nepotrebnim vremenom obrade na klijentu. Da bi promjene stupile na snagu, vozilo se mora ponovno mrijestiti ili reproducirati. Na svakoj tablici postoji ograničenje od 32 znaka (uključujući ugrađene boje). Dužina teksta koja se može vidjeti na pločici s brojevima je oko 9 do 10 znakova, a više znakova uzrokovat će razdvajanje teksta. Neki modeli vozila imaju unazad registarsku tablicu, npr. Boxville (498) (kao alternativu ovom vozilu možete koristiti model vozila ID 609, koji je duplicirani Boxville (zvan Boxburg), ali s redovnom tablicom). ::: :::tip Na tekstu pločice možete koristiti ugrađivanje boja. ::: ## Srodne Funkcije - [SetVehicleToRespawn](SetVehicleToRespawn): Respawnuj vozilo. - [ChangeVehicleColor](ChangeVehicleColor): Postavi boju vozila. - [ChangeVehiclePaintjob](ChangeVehiclePaintjob): Promijeni paintjob na vozilu.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetVehicleNumberPlate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetVehicleNumberPlate.md", "repo_id": "openmultiplayer", "token_count": 751 }
352
--- title: ShowPlayerMarkers description: Omogućava/onemogućava markere/oznake igrača (bljeskalice na radaru). tags: ["player"] --- ## Deskripcija Omogućava/onemogućava markere/oznake igrača (bljeskalice na radaru). Mora se koristiti kada server počne (OnGameModeInit). Za ostala vremena, pogledaj SetPlayerMarkerForPlayer. | Ime | Deskripcija | | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | mode | [Mode](#marker-modes) za koristiti za markere/oznake. Mogu se emitirati, što znači da su vidljivi samo igračima u blizini. Pogledajte donju tabelu. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnGameModeInit() { // Oznake igrača vidljive samo igračima u blizini ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED); } ``` ## Marker Modes | ID | MODE | | --- | ---------------------------- | | 0 | PLAYER_MARKERS_MODE_OFF | | 1 | PLAYER_MARKERS_MODE_GLOBAL | | 2 | PLAYER_MARKERS_MODE_STREAMED | ## Zabilješke :::tip Takođe je moguće postaviti boju igrača na boju koja ima potpunu prozirnost (bez alfa vrijednosti). To omogućava prikazivanje markera/oznaka po igraču. ::: ## Srodne Funkcije - [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): Postavite marker/oznaku igrača. - [LimitPlayerMarkerRadius](LimitPlayerMarkerRadius): Ograničite radijus markera/oznake igrača. - [ShowNameTags](ShowNameTags): Postavi nametagove uključeno ili isključeno. - [SetPlayerColor](SetPlayerColor): Postavi boju igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/ShowPlayerMarkers.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ShowPlayerMarkers.md", "repo_id": "openmultiplayer", "token_count": 799 }
353
--- title: TextDrawHideForAll description: Sakriva textdraw za sve igrače. tags: ["textdraw"] --- ## Deskripcija Sakriva textdraw za sve igrače. | Ime | Deskripcija | | ---- | -------------------------------------------------------------- | | text | ID textdrawa za sakriti (returnovan/vraćen od TextDrawCreate). | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c new Text: gMyTextdraw; gMyTextdraw = TextDrawCreate(...); //Kasnije TextDrawShowForAll(gMyTextdraw); //Još kasnije TextDrawHideForAll(gMyTextdraw); ``` ## Srodne Funkcije - [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.
openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawHideForAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawHideForAll.md", "repo_id": "openmultiplayer", "token_count": 381 }
354
--- title: TogglePlayerClock description: Uključite sat u igri (gornji desni kut) za određenog igrača. tags: ["player"] --- ## Deskripcija Uključite sat u igri (gornji desni kut) za određenog igrača. Kada je ovo omogućeno, vrijeme će napredovati 1 minutu u sekundi. Vrijeme će se također interpolirati (polako mijenjati tokom vremena) kada se postavi pomoću SetWeather / SetPlayerWeather. | Ime | Deskripcija | | -------- | ------------------------------------------------------------------- | | playerid | Igrač čiji sat želite omogućiti / onemogućiti | | toggle | 1 da ga prikažete 0 da ga sakrijete. Skriven po zadanim postavkama. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. The specified player does not exist. ## Primjeri ```c public OnPlayerConnect(playerid) { TogglePlayerClock(playerid, 1); // Prikaži sat return 1; } ``` ## Zabilješke :::tip Vrijeme će automatski napredovati za 6 sati kada igrač umre. ::: ## Srodne Funkcije - [GetPlayerTime](GetPlayerTime): Dobij vrijeme igrača. - [SetPlayerTime](SetPlayerTime): Postavi igraču vrijeme. - [SetWorldTime](SetWorldTime): Postavi globalno vrijeme servera.
openmultiplayer/web/docs/translations/bs/scripting/functions/TogglePlayerClock.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TogglePlayerClock.md", "repo_id": "openmultiplayer", "token_count": 558 }
355
--- title: deleteproperty description: Izbriši prethodno postavljenu imovinu (setproperty). tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Izbriši prethodno postavljenu imovinu (setproperty). | Ime | Deskripcija | | ----- | ---------------------------------------------------------------------------- | | id | Virtualna mašina za upotrebu. Trebali biste ovo držati kao nulu. | | Ime[] | Ime imovine, trebali biste ovo ostaviti prazno (""). | | value | Jedinstveni ID imovine. Upotrijebite hash-funkciju za izračunavanje iz niza. | ## Returns Vrijednost imovine. Ako imovina ne postoji, funkcija returna/vrača 0. ## Primjeri ```c deleteproperty(0, "", 123984334); ``` ## Zabilješke :::tip Preporučljivo je da koristite PVars/SVars ili GVar plugin umjesto ovih native-a zbog njihove brzine (spori su). ::: ## Srodne Funkcije - [setproperty](setproperty): Postavi imovinu. - [getproperty](getproperty): Dobij vrijednost imovine. - [existproperty](existproperty): Provjeri da li imovina postoji.
openmultiplayer/web/docs/translations/bs/scripting/functions/deleteproperty.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/deleteproperty.md", "repo_id": "openmultiplayer", "token_count": 525 }
356
--- title: floatmul description: Množi dva floata jedni s drugima. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Množi dva floata jedni s drugima. | Ime | Deskripcija | | ----- | ----------------------------------- | | oper1 | Prvi Float. | | oper2 | Drugi Float, s kojim se prvi množi. | ## Returns Proizvod dva data plovka ## Primjeri ```c public OnGameModeInit() { new Float:Number1 = 2.3, Float:Number2 = 3.5; //Deklarira dva floata, Number1 (2.3) i Number2 (3.5) new Float:Product; Product = floatmul(Number1, Number2); //Sprema proizvod (= 2,3 * 3,5 = 8,05) broja1 i broja2 u plovak "Proizvod" return 1; } ``` ## Zabilješke :::tip Ova je funkcija prilično suvišna, jer se ne razlikuje od konvencionalnog operatora množenja (\*). ::: ## Srodne Funkcije - [Floatadd](Floatadd): Dodaje dva plovka. - [Floatsub](Floatsub): Oduzima dva floata. - [Floatdiv](Floatdiv): Dijeli float sa drugim.
openmultiplayer/web/docs/translations/bs/scripting/functions/floatmul.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/floatmul.md", "repo_id": "openmultiplayer", "token_count": 478 }
357
--- title: funcidx description: Ova funkcija vraća ID javne funkcije po imenu. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Ova funkcija vraća ID javne funkcije po imenu. | Ime | Deskripcija | | ------------ | ------------------------------------- | | const name[] | Ime javne funkcije za dobivanje ID-a. | ## Returns ID funkcije (ID-ovi počinju na 0). -1 ako funkcija ne postoji. ## Primjeri ```c public OnFilterScriptInit() { printf("ID od OnFilterScriptInit: %d", funcidx("OnFilterScriptInit")); return 1; } ``` ## Srodne Funkcije - [CallLocalFunction](CallLocalFunction): Pozovite funkciju u skripti. - [CallRemoteFunction](CallRemoteFunction): Pozovite funkciju u bilo kojoj učitanoj skripti.
openmultiplayer/web/docs/translations/bs/scripting/functions/funcidx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/funcidx.md", "repo_id": "openmultiplayer", "token_count": 330 }
358
--- title: printf description: Ispisuje formatirani niz na konzoli (prozor servera, a ne chat u igri). tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Ispisuje formatirani niz na konzoli (prozor servera, a ne chat u igri). | Ime | Deskripcija | | -------------- | ---------------------------------------------- | | format[] | Formatirani string. | | {Float,\_}:... | Neograničeni broj argumenata bilo koje oznake. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Format Specifiers | Specifier | Meaning | | --------- | ----------------------------------------------- | | %i | Cijeli broj | | %d | Cijeli broj | | %s | String | | %f | Float broj | | %c | ASCII karakter | | %x | Hexadecimalni broj | | %b | Binarni broj | | %% | Literal '%' | | %q | Izbjegnite tekst za SQLite. (Dodano u 0.3.7 R2) | Vrijednosti rezerviranih mjesta slijede se potpuno istim redoslijedom kao i parametri u pozivu, tj. "Imam %i godina" - `%i` će biti zamijenjena cjelobrojnom varijablom, što je dob osobe. Po želji možete staviti broj između `%` i slovo koda rezerviranog mjesta. Ovaj broj označava širinu polja; ako je veličina parametra za ispis na mjestu rezerviranog mjesta manja od širine polja, polje se proširuje razmacima. Da biste smanjili broj decimalnih mjesta koja se prikazuju na floatu, možete dodati `.\<max number\>` između `%` i `f`, tj. `%.2f`. ## Primjeri ```c new number = 42; printf("The number is %d.",number); //-> Broj je 42. new string[]= "prosta poruka"; printf("This is a %s containing the number %d.", string, number); //-> Ovo je prosta poruka koja sadrži broj 42. new character = 64; printf("I'm %c home",character); //-> I'm @ home ``` ## Zabilješke :::warning Niz formata ili njegov izlaz ne smije prelaziti 1024 znaka. Sve što je duže od te dužine može dovesti do pada servera. ::: ## Srodne Funkcije - [print](./print): Ispišite osnovnu poruku u zapisnike poslužitelja i konzolu. - [format](./format): Formatira string.
openmultiplayer/web/docs/translations/bs/scripting/functions/printf.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/printf.md", "repo_id": "openmultiplayer", "token_count": 1309 }
359
--- title: AddStaticPickup description: Fügt ein 'static' Pickup zum Spiel hinzu. tags: [Pickup] --- ## Beschreibung Fügt ein 'static' Pickup zum Spiel hinzu. Diese Pickups unterstützen Waffen, Leben, Rüstung etc., mit der Fähigkeit ohne gescripted zu werden zu funktionieren. (weapons/health/armor wird automatisch gegeben). | Name | Beschreibung | | ----------------------------------- | ----------------------------------------------------------------------------------- | | [model](../resources/pickupids) | Die Model ID des Pickups. | | [type](../resources/pickuptypes) | Der Pickup Typ. Beeinflusst das Verhalten, wenn das Pickup aufgehoben wird. | | Float:X | Die X Koordinate an der das Pickup erstellt wird. | | Float:Y | Die Y Koordinate an der das Pickup erstellt wird. | | Float:Z | Die Z Koordinate an der das Pickup erstellt wird. | | virtualworld | Die virtuelle Welt in der das Pickup erstellt wird. Nutze -1 um es in jeder virtuellen Welt zu zeigen. | ## Rückgabe(return value) 1 wenn das Pickup erstellt wurde. 0 wenn das Pickup nicht erstellt werden konnte. ## Beispiele ```c public OnGameModeInit() { // Erstelle ein Pickup für Armor (Rüstung) AddStaticPickup(1242, 2, 1503.3359, 1432.3585, 10.1191, 0); // Erstelle ein Pickup für Health (Leben) AddStaticPickup(1240, 2, 1506.3359, 1432.3585, 10.1191, 0); return 1; } ``` ## Anmerkungen :::tip Diese Funktion gibt keine ID zurück, mit der auf das Objekt zugegriffen werden kann (z.B. in OnPlayerPickUpPickup). Nutze stattdessen CreatePickup wenn du mit der ID arbeiten möchtest. ::: ## Related Functions - [CreatePickup](CreatePickup): Erstellt ein Pickup. - [DestroyPickup](DestroyPickup): Löscht ein Pickup. - [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup): Wird aufgerufen wenn ein Spieler ein Pickup aufhebt.
openmultiplayer/web/docs/translations/de/scripting/functions/AddStaticPickup.md/0
{ "file_path": "openmultiplayer/web/docs/translations/de/scripting/functions/AddStaticPickup.md", "repo_id": "openmultiplayer", "token_count": 1089 }
360
--- título: OnFilterScriptExit descripción: Este callback se llama cuando termina la ejecución de un filterscript. Sólo se llama adentro del mismo filterscript. tags: [] --- ## Descripción Este callback se llama cuando termina la ejecución de un filterscript. Sólo se llama adentro del mismo filterscript. ## Ejemplos ```c public OnFilterScriptExit() { print("\n--------------------------------------"); print(" Mi filterscript dejó de ejecutarse"); print("--------------------------------------\n"); return 1; } ``` ## Funciones Relacionadas
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnFilterScriptExit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnFilterScriptExit.md", "repo_id": "openmultiplayer", "token_count": 190 }
361
--- título: OnPlayerEditObject descripción: Este callback se llama cuando un jugador termina de editar un objeto (EditObject/EditPlayerObject). tags: ["player"] --- ## Descripción Este callback se llama cuando un jugador termina de editar un objeto (EditObject/EditPlayerObject). | Nombre | Descripción | |------------------------|-----------------------------------------------------------------| | playerid | El ID del jugador que editó un objeto. | | playerobject | 0 si fue un objeto global o 1 si fue un objeto de jugador. | | objectid | El ID del objeto que fue editado. | | EDIT_RESPONSE:response | El [tipo de respuesta](../resources/objecteditionresponsetypes) | | Float:fX | La coordenada X para el objeto que fue editado. | | Float:fY | La coordenada Y para el objeto que fue editado. | | Float:fZ | La coordenada Z para el objeto que fue editado. | | Float:fRotX | La rotación X para el objeto que fue editado. | | Float:fRotY | La rotación Y para el objeto que fue editado. | | Float:fRotZ | La rotación Z para el objeto que fue editado. | ## 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 public OnPlayerEditObject(playerid, playerobject, objectid, EDIT_RESPONSE:response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) { new Float: oldX, Float: oldY, Float: oldZ, Float: oldRotX, Float: oldRotY, Float: oldRotZ; GetObjectPos(objectid, oldX, oldY, oldZ); GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ); if (!playerobject) //Si es un objeto global, sincroniza la posición para los demás jugadores { if (!IsValidObject(objectid)) { return 1; } SetObjectPos(objectid, fX, fY, fZ); SetObjectRot(objectid, fRotX, fRotY, fRotZ); } switch (response) { case EDIT_RESPONSE_FINAL: { // El jugador clickeó en el ícono de guardar // Hacer algo acá para guardar la posición y rotación del objeto actualizado } case EDIT_RESPONSE_CANCEL: { //El jugador canceló, entonces ponemos el objeto de vuelta a su posición antigua if (!playerobject) //El objeto no es un objeto de jugador { SetObjectPos(objectid, oldX, oldY, oldZ); SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ); } else { SetPlayerObjectPos(playerid, objectid, oldX, oldY, oldZ); SetPlayerObjectRot(playerid, objectid, oldRotX, oldRotY, oldRotZ); } } } return 1; } ``` ## Notas :::warning Cuando se usa 'EDIT_RESPONSE_UPDATE' sé consciente de que este callback no será llamado cuándo se lanze una edición en progreso, resultando en que la última actualización de 'EDIT_RESPONSE_UPDATE' quede fuera de sincronización con la posición actual de los objetos. ::: ## Funciones Relacionadas - [EditObject](../functions/EditObject): Editar un objeto. - [CreateObject](../functions/CreateObject): Crear un objeto. - [DestroyObject](../functions/DestroyObject): Destruir un objeto. - [MoveObject](../functions/MoveObject): Mover un objeto.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerEditObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerEditObject.md", "repo_id": "openmultiplayer", "token_count": 1727 }
362
--- título: OnPlayerRequestDownload descripción: Este callback se llama cuando un jugador solicita por descargas de modelos personalizados. tags: ["player"] --- <VersionWarnES name='callback' version='SA-MP 0.3.DL R1' /> ## Descripción Este callback se llama cuando un jugador solicita por descargas de modelos personalizados. | Nombre | Descripción | | -------- | -------------------------------------------------------- | | playerid | El ID del jugador que solicita descargar modelos custom. | | type | El tipo de solicitud (ver abajo). | | crc | La suma de comprobación CRC del archivo del modelo. | ## Devoluciones 0 - Denegar la solicitud de descarga 1 - Aceptar la solicitud de descarga ## Ejemplos ```c #define DOWNLOAD_REQUEST_EMPTY (0) #define DOWNLOAD_REQUEST_MODEL_FILE (1) #define DOWNLOAD_REQUEST_TEXTURE_FILE (2) new baseurl[] = "https://files.sa-mp.com/server"; public OnPlayerRequestDownload(playerid, type, crc) { new fullurl[256+1]; new dlfilename[64+1]; new foundfilename=0; if (!IsPlayerConnected(playerid)) return 0; if (type == DOWNLOAD_REQUEST_TEXTURE_FILE) { foundfilename = FindTextureFileNameFromCRC(crc,dlfilename,64); } else if (type == DOWNLOAD_REQUEST_MODEL_FILE) { foundfilename = FindModelFileNameFromCRC(crc,dlfilename,64); } if (foundfilename) { format(fullurl,256,"%s/%s",baseurl,dlfilename); RedirectDownload(playerid,fullurl); } return 0; } ``` ## Funciones Relacionadas - [OnPlayerFinishedDownloading](OnPlayerFinishedDownloading): Se llama cuando un jugador termina de descargar modelos personalizados.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerRequestDownload.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerRequestDownload.md", "repo_id": "openmultiplayer", "token_count": 693 }
363
--- título: OnUnoccupiedVehicleUpdate descripción: Este callback se llama cuando el cliente de un jugador actualiza/sincroniza la posición de un vehículo que él no está conduciendo. tags: ["vehicle"] --- ## Descripción Este callback se llama cuando el cliente de un jugador actualiza/sincroniza la posición de un vehículo que él no está conduciendo. Esto puede suceder fuera del vehículo o cuando el jugador es un pasajero de un vehículo que no tiene conductor. | Name | Description | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | vehicleid | El ID del vehículo al que se le actualizó la posición. | | playerid | El ID que envió la actualización de sincronización de la posición del vehículo. | | passenger_seat | La ID del asiento si el jugador es un pasajero. 0 = no está en el vehículo, 1 = pasajero delantero, 2 = trasero izquierdo 3 = trasero derecho 4+ es para coach / bus, etc. con muchos asientos para pasajeros. | | new_x | La nueva coordenada X del vehículo. anterior. | | new_y | La nueva coordenada Y del vehículo. anterior. | | new_z | La nueva coordenada Z del vehículo. anterior. | | vel_x | La nueva velocidad X del vehículo. anterior. | | vel_y | La nueva velocidad Y del vehículo. anterior. | | vel_z | La nueva velocidad Z del vehículo. anterior. | ## 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 public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z) { // Comprueba si lo movió lejos if (GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z) > 50.0) { // Rechazar la actualización return 0; } return 1; } ``` ## Notas :::warning Este callback se llama muy frecuentemente por segundo por cada vehículo. Deberías abstenerte de implementar cálculos intensivos o operaciones de escritura/lectura sobre archivos en este callback. GetVehiclePos las coordenadas antiguas del vehículo antes de esta actualización. ::: ## Funciones Relacionadas
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnUnoccupiedVehicleUpdate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnUnoccupiedVehicleUpdate.md", "repo_id": "openmultiplayer", "token_count": 1531 }
364
--- title: Sistema de Varibles de Jugador description: El sistema de variables de jugador (abreviado, PVar) es una nueva forma de crear variables de jugador en un método eficiente creado dinámicamente de forma global, lo que significa que se pueden utilizar en el gamemode y en los filterscripts al mismo tiempo. --- El sistema de variables de jugador (abreviado, PVar) es una nueva forma de crear variables de jugador en un método eficiente creado dinámicamente de forma global, lo que significa que se pueden utilizar en el gamemode y en los filterscripts al mismo tiempo. Son similiares a [SVars](servervariablesystem), pero son por jugador. Ver los 2 últimos posts en este hilo para leer sobre la diferencia entre propiedades de pawn y PVars. ## Ventajas El nuevo sistema introducido en SA-MP 0.3a R5, tiene varias ventajas importantes sobre la creación de un array de tamaño MAX_PLAYERS. - Los PVars pueden ser compartidos/accesibles entre de gamemode y filterscripts, haciendo más fácil modularizar tu código. - Las PVars se borran automáticamente cuando un jugador abandona el servidor (después de OnPlayerDisconnect), lo que significa que no tienes que reiniciar manualmente las variables para el siguiente jugador que se una. - No hay necesidad de complejos enums o estructuras de información de jugador. - Ahorra memoria al no asignar elementos de pawn array para los playerids que probablemente nunca se utilizarán. - Puedes enumerar e imprimir/almacenar fácilmente la lista PVar. Esto facilita tanto la depuración como el almacenamiento de la información del jugador. - Incluso si un PVar no ha sido creado, devolverá un valor por defecto de 0. - Los PVars pueden contener cadenas muy grandes utilizando memoria asignada dinámicamente. - Puedes establecer, obtener y crear PVars en el juego. ## Desventajas - Las PVars son mucho más lentas que las variables normales. Por lo general, es mejor cambiar memoria por velocidad que al revés. ## Funciones Las funciones para establecer y obtener las variables de jugador son: - [SetPVarInt](../scripting/functions/SetPVarInt) Establece un valor de tipo Int para una variable de jugador. - [GetPVarInt](../scripting/functions/GetPVarInt) Obtiene un valor de tipo Int de una variable de jugador. - [SetPVarString](../scripting/functions/SetPVarString) Establece un valor de tipo String para una variable de jugador. - [GetPVarString](../scripting/functions/GetPVarString) Obtiene un valor de tipo String de una variable de jugador. - [SetPVarFloat](../scripting/functions/SetPVarFloat) Establecer un valor de tipo Float para una variable de jugador.. - [GetPVarFloat](../scripting/functions/GetPVarFloat) Obtiene una variable de tipo float de una variable de jugador. - [DeletePVar](../scripting/functions/DeletePVar) Elimina una variable de jugador. ```c #define PLAYER_VARTYPE_NONE (0) #define PLAYER_VARTYPE_INT (1) #define PLAYER_VARTYPE_STRING (2) #define PLAYER_VARTYPE_FLOAT (3) ```
openmultiplayer/web/docs/translations/es/tutorials/perplayervariablesystem.md/perplayervariablesystem/0
{ "file_path": "openmultiplayer/web/docs/translations/es/tutorials/perplayervariablesystem.md/perplayervariablesystem", "repo_id": "openmultiplayer", "token_count": 1033 }
365
--- title: Common Issues --- ## Contents ## Client ### Nagka error ako "San Andreas cannot be found" Ang San Andreas Multiplayer ay **hindi** stand-alone program! Nagdadag-dag lamang ito ng functionality sa GTA San Andreas, bagkus ay kailangan ang GTA San Andreas na laro para sa PC. Kailangan din itong maging **EU/US v1.0**, ang ibang version tulad ng v2.0 o Steam at Direct2Drive versions ay hindi gagana. [pindutin dito upang i-downgrade ang iyong GTA: SA version sa 1.0](http://grandtheftauto.filefront.com/file/GTA_SA_Downgrader_Patch;74661) ### Wala akong makitang server sa SA:MP client ko! Una, dapat ay siguraduhing sinusundan ang tamang proseso na nakalapat sa [Quick-start guide](https://team.sa-mp.com/wiki/Getting_Started). Kung sinundan ito, at hindi parin nakikita ang mga servers sa iyong SA:MP client, kaialangan mong i-allow ang SA:MP sa iyong firewall. Sa kasamaang palad, dahil sa dami ng availanle na firewall softwares, hindi namin kayo matutulungan dito - pero suggest namin na maghanap kayo sa website ng manufacturer o maghanap ng solusyon sa Google search. At wag kalimutin na updated ang inyong SA:MP client sa latest na version! ### Singleplayer loads instead of SA:MP :::warning Hindi ka dapat makakita ng singleplayer options kapag binuksan ang GTA mula sa SA:MP client (new game, load game, etc.) - Ang SA:MP ay magbubukas mag-isa at hindi ipapakita ang mga options na ito. Kapag nakakita ka ng options na mga to tulad ng "new game", magbubukas ang Single Player at hindi ang San Andreas Multiplayer. ::: Ang Singleplayer ay maaaring mag lumitaw sa dalawang rason; hindi mo na install ng maayos ang iyong SA:MP at wala ito sa GTA San Andreas game folder o maling version ng GTA San Andreas ang iyong gamit. Kung maling version ng GTA San Andreas ang iyong ginagamit ay maaari mo itong ma downgrade gamit ang GTA San Andreas Downgrader. Pindutin [ito](http://grandtheftauto.filefront.com/file/GTA_SA_Downgrader_Patch;74661) para ma download ito. Minsan ang single player menu ay lalabas, pero ang SA:MP ay nag bukas naman siguro, subukang pumili sa mga options na ito sa menu at pindutin ang `ESC` key para makaalis dito. Ang SA:MP ay magbubukas na. ### May lumalabas na "Unacceptable Nickname" kapag pumapasok ako sa server! Siguraduhing ikaw ay hindi gumagamit ng pinagbabawal na mga characters sa iyong pangalan na ilinagay, gamitin ang (0-9, a-z, \[\], (), \$, @, ., \_ at = lamang), at dapat ang pangalan ay hindi lumalagpas sa 20 characters. Maaari din itong mangyari kapag ang pangalan na iyong ginagamit ay nasa loob na ng server na pinapasukan (Na pwedeng mangyari kapag nag rereconnect ka ng madalas pagkatapos mag timeout o mag crash). Ang window na nag rurun ng SA:MP sa humigit na 50 araw ay minsan ang dahilan sa bug na ito. ### Ang screen ko ay nagpapakita lamang ng "Connecting to IP:Port..." Ang server ay pwedeng offline, o kung hindi maka connect sa server, subukang patayin ang firewall at tignan kung gagana ito. Kung gumana, kailangan mong i reconfigure ang iyong firewall. Maaari din na ikaw ay gumagamit ng outdated na version ng SA:MP - mahahanap mo ang updated na version ng SA:MP [dito](http://sa-mp.com/download.php). ### Meron akong mods sa GTA San Andreas at ang SA:MP ay ayaw bumukas. Kapag ayaw bumukas, delete mo ang iyong mods na sa tingin mo ay nagbibigay ng problemang ito. ### Kapag binubuksan ko ang GTA gamit ang SA:MP ayaw nitong bumukas. I delete ang gta_sa.set sa iyong userfiles folder at siguraduhing wala kang cheats o mods. ### Nag c-crash ang aking laro kapag may sumabog na sasakyan. Kung meron kang dalawang monitor sa PC merong tatlong paraan para maayos ito: 1. I-Disable ang 2dr monitor kapag naglalaro ka ng SA:MP. (Hindi siguro matalinong paraan kapag gusto mong maglaro ng SA:MP sa iyong dalawang monitor.) 2. I-Set ang Visual FX Quality sa low. (ESC > Options > Display Setup > Advanced) 3. Rename mo ang iyong GTA San Andreas folder (halimbawa: "GTA San Andreas2" o GTA "San_Andreas") (Madalas itong gumana, ngunit minsan ay hindi gagana kaya kailangan mong i-rename ito muli.) ### Hindi na gumagana ang aking mouse katapos kong umalis sa pause menu. Kung hindi na gumagana o nag freeze ang iyong mouse katapos umalis sa game menu pero gumagana ito sa game menu, kailangan mong i-disable ang multicore option [sa-mp.cfg](../../../client/ClientCommands#file-sa-mpcfg "Sa-mp.cfg") (set mo ito sa 0). Tuloy-tuloy na pag pindot sa `ESC` button hanggang gumana ang mouse ay maaaring maging solusyon, pero hindi ito malinis na solusyon at matagal itong gawin. ### The file dinput8.dll is missing Lumalabas ito kapag ang iyong DirectX ay hindi na install ng tama, subukang i re-install ito - Wag kalimutang i-restart ang iyong PC. Kung naroon padin ang problema, punta ka nalang sa `C:\\Windows\\System32` at i copy paste ang dinput.dll na file papunta sa folder ng iyong GTA San Andreas. Maaayos na ito katapos. ### I cannot see other player's nametags! Hindi ko makita ang nametag ng ibang players! Kailangan mong tandaan na minsan ang server na iyong pinasukan ay dinidisable ang nametags. Kung hindi man, ang problemang ito ay nangyayari sa mga computer na may Intel HD integrated graphics processors (na hindi naman talaga pang gaming). Sa kasamaang palad, walang unibersal na solusyon para dito, ang aayos lang dito ay mag install ng dedicated na graphics card para sa iyong computer, kung kaya naman ito ng iyong bulsa.
openmultiplayer/web/docs/translations/fil/client/CommonClientIssues.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/client/CommonClientIssues.md", "repo_id": "openmultiplayer", "token_count": 1862 }
366
--- title: OnNPCConnect description: Tinatawag ang callback na ito kapag matagumpay na nakakonekta ang isang NPC sa server. tags: ["npc"] --- ## Description Tinatawag ang callback na ito kapag matagumpay na nakakonekta ang isang NPC sa server. | Name | Description | | ------------ | -------------------------------------------------- | | myplayerid | Ang playerid na binigay sa NPC | ## Examples ```c public OnNPCConnect(myplayerid) { printf("I successfully connected the server with ID %i!", myplayerid); } ``` ## Related Callbacks Maaaring maging kapaki-pakinabang ang mga sumusunod na callback, dahil nauugnay ang mga ito sa callback na ito sa isang paraan o iba pa. - [OnNPCDisconnect](OnNPCDisconnect): Ang callback na ito ay tinatawag kapag ang NPC ay nadiskonekta sa server. - [OnPlayerConnect](OnPlayerConnect): Tinatawag ang callback na ito kapag kumonekta ang isang player sa server. - [OnPlayerDisconnect](OnPlayerDisconnect): Ang callback na ito ay tinatawag kapag ang isang manlalaro ay umalis sa server.
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnNPCConnect.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnNPCConnect.md", "repo_id": "openmultiplayer", "token_count": 410 }
367
--- title: OnPlayerEnterCheckpoint description: Tinatawag ang callback na ito kapag pumasok ang isang player sa checkpoint set para sa player na iyon. tags: ["player", "checkpoint"] --- ## Description Tinatawag ang callback na ito kapag pumasok ang isang player sa checkpoint set para sa player na iyon. | Name | Description | | -------- | -------------------------------------- | | playerid | Ang player na pumasok sa checkpoint | ## Returns Palaging una itong tinatawag sa mga filterscript. ## Examples ```c //Sa halimbawang ito, isang checkpoint ang ginawa para sa player kapag nag-spawn, //na lumilikha ng sasakyan at hindi pinapagana ang checkpoint. public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); return 1; } public OnPlayerEnterCheckpoint(playerid) { CreateVehicle(520, 1982.6150, -221.0145, -0.2432, 82.2873, -1, -1, 60000); DisablePlayerCheckpoint(playerid); return 1; } ``` ## Notes <TipNPCCallbacks /> ## Related Callbacks Maaaring maging kapaki-pakinabang ang mga sumusunod na callback, dahil nauugnay ang mga ito sa callback na ito sa isang paraan o iba pa. - [OnPlayerLeaveCheckpoint](OnPlayerLeaveCheckpoint): Ang callback na ito ay tinatawag kapag ang isang player ay umalis sa isang checkpoint. - [OnPlayerEnterRaceCheckpoint](OnPlayerEnterRaceCheckpoint): Ang callback na ito ay tinatawag kapag ang player manlalaro ay pumasok sa isang race checkpoint. - [OnPlayerLeaveRaceCheckpoint](OnPlayerLeaveRaceCheckpoint): Ang callback na ito ay tinatawag kapag ang player manlalaro ay umalis sa isang race checkpoint. ## Related Functions Maaaring maging kapaki-pakinabang ang mga sumusunod na function, dahil nauugnay ang mga ito sa callback na ito sa isang paraan o iba pa. - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): Gumawa ng checkpoint para sa isang player. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): Huwag paganahin ang kasalukuyang checkpoint ng player. - [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint): Suriin kung ang isang player ay nasa isang checkpoint. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): Gumawa ng race checkpoint para sa isang player. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): I-disable ang kasalukuyang race checkpoint ng player. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): Suriin kung ang isang player ay nasa isang checkpoint ng karera.
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerEnterCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerEnterCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 834 }
368
--- title: AddStaticVehicle description: Nagdaragdag ng 'static' na sasakyan (na-pre-load ang mga modelo para sa mga manlalaro) sa gamemode. tags: ["vehicle"] --- ## Description Nagdaragdag ng 'static' na sasakyan (na-pre-load ang mga modelo para sa mga manlalaro) sa gamemode. | Name | Description | | ---------------------------------------- | -------------------------------------- | | modelid | Ang Model ID para sa sasakyan. | | Float:spawn_X | Ang X-coordinate para sa sasakyan. | | Float:spawn_Y | Ang Y-coordinate para sa sasakyan. | | Float:spawn_Z | Ang Z-coordinate para sa sasakyan. | | Float:z_angle | Direksyon ng sasakyan - anggulo. | | [color1](../resources/vehiclecolorid) | Ang pangunahing ID ng kulay. -1 para sa random. | | [color2](../resources/vehiclecolorid) | Ang pangalawang kulay ID. -1 para sa random. | ## Returns Ang ID ng sasakyan ng sasakyang ginawa (sa pagitan ng 1 at MAX_VEHICLES). INVALID_VEHICLE_ID (65535) kung hindi ginawa ang sasakyan (naabot na ang limitasyon ng sasakyan o naipasa ang di-wastong ID ng modelo ng sasakyan). ## Examples ```c public OnGameModeInit() { // Mag lagay ng Hydra sa laro AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); return 1; } ``` ## Related Functions - [AddStaticVehicleEx](AddStaticVehicleEx): Magdagdag ng static na sasakyan na may custom na respawn time. - [CreateVehicle](CreateVehicle): Gumawa ng sasakyan. - [DestroyVehicle](DestroyVehicle): Sirain ang sasakyan.
openmultiplayer/web/docs/translations/fil/scripting/functions/AddStaticVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/AddStaticVehicle.md", "repo_id": "openmultiplayer", "token_count": 769 }
369
--- title: CancelEdit description: Cancel object edition mode for a player. tags: [] --- ## Description Kanselahin ang object edition mode para sa isang player. | Name | Description | | -------- | ------------------------------------------ | | playerid | Ang ID ng player na kakanselahin ang edition| ## Returns Ang function na ito ay hindi nagbabalik ng anumang value. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/stopedit", true)) { CancelEdit(playerid); SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You stopped editing the object!"); return 1; } return 0; } ``` ## Related Functions - [SelectObject](SelectObject): Pumili ng object. - [EditObject](EditObject): I-edit ang object. - [EditPlayerObject](EditPlayerObject): I-edit ang player object. - [EditAttachedObject](EditAttachedObject): I-edit ang naka kabit na object. - [CreateObject](CreateObject): Gumawa ng object. - [DestroyObject](DestroyObject): Sirain ang object. - [MoveObject](MoveObject): Ilipat ang object.
openmultiplayer/web/docs/translations/fil/scripting/functions/CancelEdit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/CancelEdit.md", "repo_id": "openmultiplayer", "token_count": 379 }
370
--- title: GangZoneHideForAll description: Ang GangZoneHideForAll ay nagtatago ng gangzone mula sa lahat ng mga manlalaro. tags: ["gangzone"] --- ## Description Ang GangZoneHideForAll ay nagtatago ng gangzone mula sa lahat ng mga manlalaro. | Name | Description | | ---- | ----------------- | | zone | Ang zone na itatago. | ## Returns Ang function na ito ay hindi nagbabalik ng anumang value. ## Examples ```c new gGangZoneId; gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); GangZoneHideForAll(gGangZoneId); ``` ## Related Functions - [GangZoneCreate](GangZoneCreate): Gumawa ng gangzone. - [GangZoneDestroy](GangZoneDestroy): Wasakin ang isang gangzone. - [GangZoneShowForPlayer](GangZoneShowForPlayer): Magpakita ng gangzone para sa isang manlalaro. - [GangZoneShowForAll](GangZoneShowForAll): Magpakita ng gangzone para sa lahat ng manlalaro. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Magtago ng gangzone para sa isang player. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Gumawa ng gangzone flash para sa isang player. - [GangZoneFlashForAll](GangZoneFlashForAll): Gumawa ng gangzone flash para sa lahat ng manlalaro. - [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Ihinto ang pag-flash ng gangzone para sa isang player. - [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Ihinto ang pag-flash ng gangzone para sa lahat ng manlalaro.
openmultiplayer/web/docs/translations/fil/scripting/functions/GangZoneHideForAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/GangZoneHideForAll.md", "repo_id": "openmultiplayer", "token_count": 486 }
371
--- title: SetGravity description: I-set ang gravity para sa lahat ng player. tags: [] --- ## Description I-set ang gravity para sa lahat ng player. | Name | Description | | ------------- | ----------------------------------------------------------------- | | Float:gravity | Ang value ng gravity na i-seset (pagitan ng -50 and 50). | ## Returns Ang function na ito ay palaging rereturn ng 1, kahit na nabigo itong isagawa kung ang gravity ay wala sa mga limitasyon (mas mababa sa -50 o mataas sa +50). ## Examples ```c public OnGameModeInit() { // I-set ang gravity na parang buwan SetGravity(0.001); return 1; } ``` ## Notes :::warning Ang default na gravity ay 0.008. ::: ## Related Functions - [GetGravity](GetGravity): Kunin ang kasalukuyang naka set na gravity. - [SetWeather](SetWeather): I-set ang pandaigdigang panahon. - [SetWorldTime](SetWorldTime): I-set ang pandaigdigang oras ng server.
openmultiplayer/web/docs/translations/fil/scripting/functions/SetGravity.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/SetGravity.md", "repo_id": "openmultiplayer", "token_count": 379 }
372
--- title: float description: Kino-convert ang isang integer sa isang float. tags: ["floating-point"] --- <LowercaseNote /> ## Description Kino-convert ang isang integer sa isang float. | Name | Description | | ----- | ----------------------------------- | | value | Integer value na i-convert sa isang float| ## Returns Ang ibinigay na integer bilang isang float ## Examples ```c new Float:FloatValue; new Value = 52; FloatValue = float(Value); // Kino-convert ang Value(52) sa isang float at iniimbak ito sa 'FloatValue' (52.0) ``` ## Related Functions - [floatround](floatround): I-convert ang isang float sa isang integer (rounding). - [floatstr](floatstr): I-convert ang isang string sa isang float.
openmultiplayer/web/docs/translations/fil/scripting/functions/float.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/float.md", "repo_id": "openmultiplayer", "token_count": 253 }
373
--- title: Client description: Cette catégorie contient des informations sur les fonctionnalités et le support du client SA-MP. --- Cette catégorie contient des informations sur les fonctionnalités et le support du client SA-MP.
openmultiplayer/web/docs/translations/fr/client/_.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/client/_.md", "repo_id": "openmultiplayer", "token_count": 71 }
374
--- title: OnGameModeInit description: Cette callback est appelée quand le gamemode démarre. tags: [gamemode, démarré, loaded, started, chargé] --- ## Paramètres Cette callback est appelée quand le gamemode démarre. ## Exemple ```c public OnGameModeInit() { print("Gamemode démarré !"); return 1; } ``` ## Astuce :::tip Cette fonction peut aussi être utilisée dans un filterscript pour détecter si le gamemode a changé avec des commandes RCON comme changemode ou gmx, puisque changer de gamemode ne recharge pas les filterscripts. ::: ## Callback connexe - [OnGameModeExit](OnGameModeExit) : callback appelée quand le gamemode s'éteint
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnGameModeInit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnGameModeInit.md", "repo_id": "openmultiplayer", "token_count": 247 }
375
--- title: OnPlayerClickTextDraw description: Cette callback est appelée quand un joueur clique sur un textdraw ou le quitte avec la touche ECHAP. tags: ["player", "textdraw"] --- ## Paramètres Cette callback est appelée quand un joueur clique sur un textdraw ou le quitte avec la touche ECHAP. | Nom | Description | | --------------- | ---------------------------------------------------------------------------------- | | `int` playerid | ID du joueur qui clique sur le textdraw. | | `int`clickedid | ID du textdraw cliqué. INVALID_TEXT_DRAW si le textdraw est quitté. | ## Valeur de retour La callback est toujours appelée en premier dans les filterscripts, donc return 1, faute de quoi les autres scripts ne pourront pas communiquer avec cette callback. ## Exemple ```c new Text:gTextDraw; public OnGameModeInit() { gTextDraw = TextDrawCreate(10.000000, 141.000000, "TextDraw"); TextDrawTextSize(gTextDraw,60.000000, 20.000000); TextDrawAlignment(gTextDraw,0); TextDrawBackgroundColor(gTextDraw,0x000000ff); TextDrawFont(gTextDraw,1); TextDrawLetterSize(gTextDraw,0.250000, 1.000000); TextDrawColor(gTextDraw,0xffffffff); TextDrawSetProportional(gTextDraw,1); TextDrawSetShadow(gTextDraw,1); TextDrawSetSelectable(gTextDraw, 1); return 1; } public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (newkeys == KEY_SUBMISSION) { TextDrawShowForPlayer(playerid, gTextDraw); SelectTextDraw(playerid, 0xFF4040AA); } return 1; } public OnPlayerClickTextDraw(playerid, Text:clickedid) { if (clickedid == gTextDraw) { SendClientMessage(playerid, 0xFFFFFFAA, "Vous avez cliqué sur le textdraw."); CancelSelectTextDraw(playerid); return 1; } return 0; } ``` ## Astuces :::warning La zone cliquable est définie par TextDrawTextSize. Les paramètres x et y ne doivent pas retourner une valeur de 0 ou une valeur négative. N'utilisez pas CancelSelectTextDraw sans condition dans cette callback. Il en résulterait une loop infinie. ::: ## Callbacks connexes - [OnPlayerClickPlayerTextDraw](OnPlayerClickPlayerTextDraw): Quand un joueur clique sur un player-textdraw. - [OnPlayerClickPlayer](OnPlayerClickPlayer): Quand un joueur clique sur un autre joueur dans la tablist. - [OnPlayerClickMap](OnPlayerClickMap): Quand un joueur place un point sur la map avec le clic droit.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickTextDraw.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickTextDraw.md", "repo_id": "openmultiplayer", "token_count": 1015 }
376
--- title: OnPlayerGiveDamageActor description: Cette callback est appelée quand un joueur inflige des dégâts à un actor. tags: ["player"] --- ## Paramètres Cette callback est appelée quand un joueur inflige des dégâts à un actor. | Nom | Description | |-----------------------|----------------------------------------------| | `int` playerid | ID du joueur qui inflige le dégât | | `int` damaged_actorid | ID de l'actor qui reçoit le dégât | | `float` Float:amount | Montant de la perte en armure/vie (combinés) | | `int` WEAPON:weaponid | Cause du dommage | | `int` bodypart | Partie du corps qui a été touchée | ## 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 OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, WEAPON:weaponid, bodypart) { new string[128], attacker[MAX_PLAYER_NAME]; weaponname[24]; GetPlayerName(playerid, attacker, sizeof (attacker)); GetWeaponName(weaponid, weaponname, sizeof (weaponname)); format(string, sizeof(string), "%s a infligé %.0f à l'actor id %d, arme: %s", attacker, amount, damaged_actorid, weaponname); SendClientMessageToAll(0xFFFFFFFF, string); return 1; } ``` ## Astuce :::tip Cette callback ne peut pas être appelée si l'actor est invulnérable _(il l'est par défaut)_. Voir [SetActorInvulnerable](../functions/SetActorInvulnerable). ::: ## Fonctions connexes - [CreateActor](../functions/CreateActor): Créer un actor (NPC statique). - [SetActorInvulnerable](../functions/SetActorInvulnerable): Met un actor invulnérable. - [SetActorHealth](../functions/SetActorHealth): Permet de heal l'actor. - [GetActorHealth](../functions/GetActorHealth): Permet d'obtenir le heal de l'actor. - [IsActorInvulnerable](../functions/IsActorInvulnerable): Permet de vérifier si un actor est invulnérable. - [IsValidActor](../functions/IsValidActor): Vérifie si un actore st valide. ## Callbacks connexes - [OnActorStreamOut](OnActorStreamOut): Appelé quand un actor n'est plus stream par un joueur. - [OnPlayerStreamIn](OnPlayerStreamIn): Appelé quand un actor est stream par un joueur.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerGiveDamageActor.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerGiveDamageActor.md", "repo_id": "openmultiplayer", "token_count": 906 }
377
--- title: OnPlayerStateChange description: Cette callback est appelée lorsqu'un joueur change d'état (à pied, dans un véhicule, en mode spectateur, etc...). tags: ["player"] --- ## Paramètres Cette callback est appelée lorsqu'un joueur change d'état _(à pied, dans un véhicule, en mode spectateur, etc...)_. | Nom | Description | | -------------- | ---------------------------------- | | `int` playerid | L'ID du joueur qui a changé d'état | | `int` newstate | Le nouvel état du joueur | | `int` oldstate | L'ancien état du joueur. | Voir ["Player States"](../resources/playerstates) pour une liste complète de tous les états d'un joueur. ## 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 OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Le joueur entre dans un véhicule en tant que conducteur (driver). { new vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); // Ajoute de la nitro (NOS) au véhicule } return 1; } ``` ## Astuces <TipNPCCallbacks /> ## Fonctions connexes - [GetPlayerState](../functions/GetPlayerState): Permet de connaître l'actuel état du joueur. - [GetPlayerSpecialAction](../functions/GetPlayerSpecialAction): Permet de connaître la "special action" actuelle du joueur. - [SetPlayerSpecialAction](../functions/SetPlayerSpecialAction): Mettre une "special action" à un joueur.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerStateChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerStateChange.md", "repo_id": "openmultiplayer", "token_count": 675 }
378
--- title: OnVehiclePaintjob description: Appelée lorsqu'un joueur change la peinture de son véhicule (dans un transfender/dans le wheel arch angel). tags: ["vehicle"] --- ## Paramètres Appelée lorsqu'un joueur change la peinture de son véhicule _(dans un transfender/dans le wheel arch angel)_. | Nom | Description | | ------------------ | -------------------------------------------------------- | | `int` playerid | L'ID du joueur qui a changé la peinture de son véhicule. | | `int` vehicleid | L'ID du véhicule dont la peinture a été changée. | | `int` paintjobid | L'ID du nouveau paintjob. | ## Valeur de retour Cette fonction ne retourne pas de valeur spécifique. ## Exemple ```c public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { new string[128]; format(string, sizeof(string), "Tu as changé la peinture de ton véhicule en : %d!", paintjobid); SendClientMessage(playerid, 0x33AA33AA, string); return 1; } ``` ## Astuces :::tip La callback est appelée lorsque le joueur modifie la peinture DANS le transfender/wheel arch angel ! ::: ## Fonctions connexes - [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob): Change the paintjob on a vehicle. - [ChangeVehicleColor](../functions/ChangeVehicleColor): Set the color of a vehicle. ## Callbacks connexes - [OnVehicleRespray](OnVehicleRespray): Called when a vehicle is resprayed. - [OnVehicleMod](OnVehicleMod): Called when a vehicle is modded.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehiclePaintjob.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehiclePaintjob.md", "repo_id": "openmultiplayer", "token_count": 630 }
379
# SA-MP Wiki és open.mp dokumentáció Üdvözlünk a SA-MP wikiben, amelyet az open.mp csapat és szélesebb körben a SA-MP közösség tart fenn! Ennek a webhelynek a célja egy könnyen hozzáférhető, és könnyen hozzájárulható dokumentációs forrás a SA-MP, illetve az open.mp számára. ## A SA-MP wiki eltűnt Sajnos a SA-MP wiki 2019 szeptember végén egy időre elérhetetlenné vált, majd később visszaállították szerkeszthetetlen archívumként. Szükségünk van a közösség segítségére, hogy a régi wiki tartalmát új otthonába hozzuk át, ide! Ha érdekel, nézd meg ezt az [oldal](/docs/translations/hu/meta/Contributing)t további információkért. Ha még nem vagy jártas a GitHub használatában vagy a HTML konvertálásában, ne aggódj! Úgy is segíthetsz, ha csak tájékoztatsz minket a kérdésekről (a [Discord](https://discord.com/invite/samp)on, a [Fórum](https://forum.open.mp/)on vagy a közösségi médián keresztül) és a legfontosabb dologról: a szó terjesztéséről! Tehát feltétlenül jelöljd be könyvjelzővel ezt a weboldalt, és osszd meg bárki mással, aki ismeri vagy kíváncsi arra, hogy hova került a SA-MP Wiki. Szívesen látjuk a dokumentáció fejlesztésével kapcsolatos hozzájárulásokat, valamint oktatóanyagokat és útmutatókat olyan általános feladatokhoz, mint például az egyszerű játékmódok felépítése, valamint a közös könyvtárak és beépülő modulok használata. Ha érdekel a közreműködés, akkor térj át a [GitHub oldal](https://github.com/openmultiplayer/web)ra.
openmultiplayer/web/docs/translations/hu/index.md/0
{ "file_path": "openmultiplayer/web/docs/translations/hu/index.md", "repo_id": "openmultiplayer", "token_count": 762 }
380
--- title: OnActorStreamIn description: Callback ini akan terpanggil ketika sebuah aktor berada di jangkauan stream dari klien pemain. tags: [] --- :::warning Fungsi ini telah ditambahkan dalam SA-MP 0.3.7 dan tidak bekerja pada versi dibawahnya! ::: ## Deskripsi Callback ini akan terpanggil ketika sebuah aktor berada di jangkauan stream dari klien pemain. | Nama | Deskripsi | | ----------- | --------------------------------------------------------------- | | actorid | ID dari aktor yang berada dalam jangakauan stream klien pemain. | | forplayerid | ID dari pemain yang berada di jangkauan stream aktor. | ## Returns Selalu terpanggil pertama di filterscripts. ## Contoh ```c public OnActorStreamIn(actorid, forplayerid) { new sring[40]; format(string, sizeof(string), "Actor %d berada disekitar anda.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Catatan :::tip Callback ini akan terpanggil juga oleh NPC. ::: ## Fungsi Terkait
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnActorStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnActorStreamIn.md", "repo_id": "openmultiplayer", "token_count": 453 }
381
--- title: OnPlayerCommandText description: Callback ini akan terpanggil ketika pemain memasukkan perintah kedalam chat window klien. tags: ["player"] --- ## Deskripsi Callback ini akan terpanggil ketika pemain memasukkan perintah kedalam chat window klien. Perintah adalah apapun yang dimulai dengan garis miring, misalnya /help. | Nama | Deskripsi | | --------- | -------------------------------------------------------- | | playerid | ID dari pemain yang memasukkan perintah. | | cmdtext[] | Perintah yang dimasukkan (termasuk dengan garis miring). | ## Returns Ini akan selalu terpanggil pertama di filterscripts jadi mengembalikan nilai 1 akan melarang filterscript lain untuk melihatnya. ## Contoh ```c public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/help", true)) { SendClientMessage(playerid, -1, "SERVER: Ini adalah perintah /help"); return 1; // Mengembalikan nilai 1 akan memberitahukan kepada server bahwa perintah berhasil diproses. // OnPlayerCommandText tidak akan dipanggil lagi di skrip lain. } return 0; // Mengembalikan nilai 0 akan memberitahukan kepada server bahwa perintah belum diproses oleh skrip ini. // OnPlayerCommandText akan terpanggil di skrip lain sampai salah satunya mengembalikan nilai 1. // Jika tidak ada skrip yang mengembalikan nilai 1, pesan 'SERVER: Unknown Command' akan muncuk kepada player. } ``` ## Catatan :::tip Callback ini akan terpanggil juga oleh NPC. ::: ## Related Functions - [SendRconCommand](../functions/SendRconCommand.md): Mengirimkan perintah RCON melalui skrip.
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerCommandText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerCommandText.md", "repo_id": "openmultiplayer", "token_count": 674 }
382
--- title: OnPlayerTakeDamage description: Callback ini terpanggil ketika pemain menerima damage. tags: ["player"] --- ## Deskripsi Callback ini terpanggil ketika pemain menerima damage. | Nama | Deskripsi | |-----------------|-----------------------------------------------------------------------------------------------------------------------------------| | playerid | ID dari pemain yang mendapatkan damage. | | issuerid | ID dari pemain yang memberikan damage. INVALID_PLAYER_ID jika bunuh diri. | | Float:amount | Jumlah damage yang diterima (darah and armour dikombinasikan). | | WEAPON:weaponid | ID dari senjata atau alasan yang digunakan untuk memberi damage. | | bodypart | Bagian tubuh yang terkena. | ## Returns 0 - Akan melarang filterscript lain untuk menerima callback ini. 1 - Mengindikasikan bahwa callback ini akan dilanjutkan ke filtercript lain. Ini akan selalu terpanggil pertama di filterscripts jadi mengembalikan nilai 1 akan melarang filterscript lain untuk melihatnya. ## Contoh ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID) // Jika bukan bunuh diri { new infoString[128], weaponName[24], victimName[MAX_PLAYER_NAME], attackerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, victimName, sizeof (victimName)); GetPlayerName(issuerid, attackerName, sizeof (attackerName)); GetWeaponName(weaponid, weaponName, sizeof (weaponName)); format(infoString, sizeof(infoString), "%s telah membuat %.0f damage kepada %s, senjata: %s, bodypart: %d", attackerName, amount, victimName, weaponName, bodypart); SendClientMessageToAll(-1, infoString); } return 1; } ``` ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) { // 1 kali hit mati ketika headshot dengan sniper SetPlayerHealth(playerid, 0.0); } return 1; } ``` ## Notes :::tip ID senjata akan mengembalikan nilai 37 (flame thrower) dari semua senjata yang menghasilkan api (Seperti molotov, 18). ID senjata akan mengembalikan nilai 51 dari semua senjata yang menghasilkan ledakan(Seperti RPG, grenade) playerid adalah satu-satunya yang dapat memanggil callback tersebut. Amount akan selalu memberikan damage maksimal yang bisa dilakukan oleh senjata, meskipun ketika darah yang tersisa kurang dari damage maksimal. Jadi ketika player mempunya 100.0 darah dan mendapatkan tembakan dari Desert Eagle sebagaimana memiliki damage 46.2, Ini hanya memerlukan 3 tembakan untuk membunuh pemain. 3 tembakan tersebut akan memberikan amout sebesar 46.2, meskipun saat tembakan terakhir mengenai, pemain hanya memiliki 7.6 darah tersisa. ::: :::warning GetPlayerHealth dan GetPlayerArmour akan memberikan amount lama dari pemain sebelum memanggil callback ini. Selalu cek jika issuerid valid sebelum melakukan array index. :::
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerTakeDamage.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerTakeDamage.md", "repo_id": "openmultiplayer", "token_count": 1548 }
383
--- title: GetPlayerMoney description: Mengambil jumlah uang yang dimiliki oleh pemain tags: ["player"] --- ## Deskripsi Mengambil jumlah uang yang dimiliki oleh pemain. | Nama | Deskripsi | | -------- | ----------------------------------------- | | playerid | ID dari pemain yang ingin dilihat uangnya | ## Returns Jumlah uang yang dimiliki oleh pemain. ## Contoh ```c public OnPlayerSpawn(playerid) { new string[32]; format(string, sizeof(string), "Uang anda senilai: $%i.", GetPlayerMoney(playerid)); SendClientMessage(playerid, 0xFFFFFFAA, string); } ``` ## Fungsi Terkait - [GivePlayerMoney](GivePlayerMoney): Memberikan uang ke pemain. - [ResetPlayerMoney](ResetPlayerMoney): Mengatur uang pemain menjadi \$0.
openmultiplayer/web/docs/translations/id/scripting/functions/GetPlayerMoney.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/GetPlayerMoney.md", "repo_id": "openmultiplayer", "token_count": 306 }
384
--- title: strval description: Mengkonversi sebuah string menjadi integer. tags: ["string"] --- <LowercaseNote /> ## Deskripsi Mengkonversi sebuah string menjadi integer. | Nama | Deskripsi | | -------------- | -------------------------------------------- | | const string[] | String yang akan dikonversi menjadi integer. | ## Returns Nilai integer dari sebuah string. 0 jika string bukan numerik. ## Contoh ```c new string[4] = "250"; new iValue = strval(string); // iValue menjadi '250' ``` ## Fungsi Terkait - [strcmp](strcmp): Membanding dua string untuk mengecek apakah mereka sama. - [strfind](strfind): Mencari sebuah string di string lainnya. - [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. - [strcat](strcat): Menggabungkan dua buah string menjadi sebuah string.
openmultiplayer/web/docs/translations/id/scripting/functions/strval.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/strval.md", "repo_id": "openmultiplayer", "token_count": 427 }
385
--- id: remoteconsole title: "Kendali Konsol Jarak Jauh (Remote Console - RCON)" descripion: Administrasi server jarak jauh. --- Kendali Konsole Jarak Jauh (RCON) adalah sebuah perintah cepat yang di mana Anda dapat menggunakan perintah RCON tanpa harus di dalam game atau di server Anda. Sejak versi 0.3b, RCON dihapuskan dari Penjelajah Server. Mulai sekarang, Anda harus menggunakan cara lain untuk mengakses RCON seperti penjelasan berikut. 1. Buka sebuah editor teks. 2. Tulis di baris pertama seperti ini: `rcon.exe IP PORT RCON-PASS` (Ganti IP/PORT/PASS dengan informasi server Anda) 3. Simpah file dengan nama `rcon.bat` 4. Letakkan file tersebut di direktori GTA di mana `rcon.exe` berada. 5. Jalankan `rcon.bat` 6. Masukkan perintah sesuai keinginan Anda. ![Konsol RCON](/images/server/rcon.jpg) Catatan: Tidak perlu menulis `/rcon` sebelum perintah di penjelajah server dan perintah tidak akan bekerja jika Anda melakukannya. Sebagai contohnya, jika Anda ingin mengatur ulang, Anda cukup mengetik `gmx` dan tekat Enter. Hanya itu saja yang Anda perlukan. Nikmatilah.
openmultiplayer/web/docs/translations/id/server/remoteconsole.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/server/remoteconsole.md", "repo_id": "openmultiplayer", "token_count": 434 }
386
--- title: AddSimpleModel description: Dodaje do pobrania nowy obiekt. tags: [] --- <VersionWarn version='SA-MP 0.3.DL R1' /> ## Opis Dodaje nowy niestandardowy obiekt do pobrania. Pliki modelu będą przechowywane w ścieżce Dokumenty\GTA San Andreas User Files\SAMP\cache w katalogu nazwanym adresem IP oraz portem serwera, z nazwami w formie sum kontrolnych CRC. | Nazwa | Opis | | ------------ | ------------------------------------------------------------------------------------------------------------------- | | virtualworld | ID wirtualnego świata, w którym obiekt będzie dostępny. Użyj -1, aby był dostępny we wszystkich światach. | | baseid | Bazowe ID obiektu do użycia (oryginalny obiekt, który zostanie wykorzystany, gdy pobieranie się nie uda). | | newid | Nowe ID obiektu z zakresu od -1000 do -30000 (29000 slotów), używane później w CreateObject lub CreatePlayerObject. | | dffname | Nazwa pliku .dff z kolizjami modelu, znajdującego się domyślnie w serwerowym katalogu models (ustawienie artpath). | | txdname | Nazwa pliku .txd z teksturami modelu, znajdującego się domyślnie w serwerowym katalogu models (ustawienie artpath). | ## Zwracane wartości 1: Funkcja wykonała się prawidłowo. 0: Funkcja nie wykonała się prawidłowo. ## Przykłady ```c public OnGameModeInit() { AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); return 1; } ``` ```c AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); ``` ## Uwagi :::tip `useartwork` musi być włączone w ustawieniach serwera, aby ta funkcja działała. Jeżeli ustawiony jest konkretny wirtualny świat, to gracz pobierze obiekty w momencie wejścia do niego. ::: :::warning Aktualnie nie ma żadnych restrykcji co do wywoływania tej funkcji, ale miej na uwadze, że jeżeli nie wywołasz jej w OnFilterScriptInit/OnGameModeInit, to gracze, którzy są już na serwerze, mogą nie mieć pobranych obiektów. ::: ## Powiązane funkcje - [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading.md): Wywoływane, kiedy gracz skończy pobierać niestandardowe modele.
openmultiplayer/web/docs/translations/pl/scripting/functions/AddSimpleModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AddSimpleModel.md", "repo_id": "openmultiplayer", "token_count": 1087 }
387
--- title: AttachObjectToPlayer description: Przyczepia obiekt do gracza. tags: ["player"] --- ## Opis Przyczepia obiekt do gracza. | Nazwa | Opis | | ------------- | ---------------------------------------------------- | | objectid | ID obiektu, który ma zostać przyczepiony do gracza. | | playerid | ID gracza, do którego obiekt ma zostać przyczepiony. | | Float:OffsetX | Dystans pomiędzy graczem, a obiektem (koordynat X). | | Float:OffsetY | Dystans pomiędzy graczem, a obiektem (koordynat Y). | | Float:OffsetZ | Dystans pomiędzy graczem, a obiektem (koordynat Z). | | Float:RotX | Rotacja X pomiędzy obiektem, a graczem. | | Float:RotY | Rotacja Y pomiędzy obiektem, a graczem. | | Float:RotZ | Rotacja Z pomiędzy obiektem, a graczem. | ## Zwracane wartości Ta funkcja zawsze zwraca 0. ## Przykłady ```c new gMyObject; gMyObject = CreateObject(19341, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToPlayer(gMyObject, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2); ``` ## Powiązane funkcje - [AttachObjectToObject](AttachObjectToObject.md): Przyczepia obiekt do obiektu. - [AttachObjectToVehicle](AttachObjectToVehicle.md): Przyczepia obiekt do pojazdu. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer.md): Przyczepia do gracza obiekt, który jest widoczny tylko dla niego. - [CreateObject](CreateObject.md): Tworzy obiekt. - [DestroyObject](DestroyObject.md): Kasuje obiekt. - [IsValidObject](IsValidObject.md): Sprawdza, czy podany obiekt istnieje. - [MoveObject](MoveObject.md): Przesuwa obiekt. - [StopObject](StopObject.md): Zatrzymuje obiekt. - [SetObjectPos](SetObjectPos.md): Ustawia pozycję obiektu. - [SetObjectRot](SetObjectRot.md): Ustawia rotację obiektu. - [GetObjectPos](GetObjectPos.md): Podaje pozycję obiektu. - [GetObjectRot](GetObjectRot.md): Podaje rotację obiektu. - [CreatePlayerObject](CreatePlayerObject.md): Tworzy obiekt dla konkretnego gracza. - [DestroyPlayerObject](DestroyPlayerObject.md): Kasuje obiekt gracza. - [IsValidPlayerObject](IsValidPlayerObject.md): Sprawdza, czy podany obiekt gracza istnieje. - [MovePlayerObject](MovePlayerObject.md): Przesuwa obiekt gracza. - [StopPlayerObject](StopPlayerObject.md): Zatrzymuje obiekt gracza. - [SetPlayerObjectPos](SetPlayerObjectPos.md): Ustawia pozycję obiektu gracza. - [SetPlayerObjectRot](SetPlayerObjectRot.md): Ustawia rotację obiektu gracza. - [GetPlayerObjectPos](GetPlayerObjectPos.md): Podaje pozycję obiektu gracza. - [GetPlayerObjectRot](GetPlayerObjectRot.md): Podaje rotację obiektu gracza.
openmultiplayer/web/docs/translations/pl/scripting/functions/AttachObjectToPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AttachObjectToPlayer.md", "repo_id": "openmultiplayer", "token_count": 1163 }
388