GivePlayerWeapon
From SA-MP Wiki
(Redirected from Function:GivePlayerWeapon)
Description:
Give a player a weapon with a specified amount of ammo.
(playerid, weaponid, ammo)
playerid | The ID of the player to give a weapon to. |
weaponid | The ID of the weapon to give to the player. |
ammo | The amount of ammo to give to the player. |
Return Values:
- 1: The function executed successfully.
- 0: The function failed to execute. This means the player is not connected.
GivePlayerWeapon(playerid, 26, 64); // Give playerid a sawn-off shotgun with 64 ammo
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetPlayerArmedWeapon: Set a player's armed weapon.
- GetPlayerWeapon: Check what weapon a player is currently holding.