warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
GivePlayerWeapon
Description
Give a player a weapon with a specified amount of ammo.
Name | Description |
---|---|
playerid | The ID of the player to give a weapon to. |
WEAPON:weaponid | The ID of the weapon to give to the player. |
ammo | The amount of ammo to give to the player. |
Returns
1 - The function was executed successfully.
0 - The function failed to execute. This means the player is not connected.
Examples
GivePlayerWeapon(playerid, WEAPON_SAWEDOFF, 64); // Give playerid a sawn-off shotgun with 64 ammo
Related Functions
- SetPlayerArmedWeapon: Set a player's armed weapon.
- GetPlayerWeapon: Check what weapon a player is currently holding.
- ResetPlayerWeapons: Removes all weapons from a player.
- RemovePlayerWeapon: Remove a specified weapon from a player.