GetPlayerWeapon
From SA-MP Wiki
GetPlayerWeapon
Returns the ID of the player's current weapon.
(playerid)
| playerid | The ID of the player to get the weapon of |
| Returns | The ID of the player's current weapon |
public OnPlayerDeath(playerid, killerid, reason) { if(GetPlayerWeapon(killerid) == 38) Ban(killerid); //Ban if they have a minigun return 1; }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- GetPlayerWeaponData: Find out information about weapons a player has.
- GivePlayerWeapon: Give a player a weapon.
- ResetPlayerWeapons: Remove all weapons from a player.
