Function GivePlayerWeapon give a player a weapon with a specified amount of ammo.

(playerid, weaponid, ammo)
int playerid The ID of the player to give a weapon to.
int weaponid The ID of the weapon to give to the player.
int ammo The amount of ammo to give to the player.

Return Values:
  • 1: The function was 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.