29.09.2010, 20:22
(
Последний раз редактировалось RyDeR`; 29.09.2010 в 20:58.
)
Info (DeletePlayerWeapon)
Deletes a specific weapon of a player.
Code
Example
This will delete weapon ID 28 (UZI) from the player (if he has one).
Deletes a specific weapon of a player.
Code
pawn Код:
stock DeletePlayerWeapon(playerid, weaponid)
{
new
gWeaponData[13][2]
;
for(new i; i != sizeof(gWeaponData); ++i)
{
GetPlayerWeaponData(playerid, i, gWeaponData[i][0], gWeaponData[i][1]);
gWeaponData[i][1] = gWeaponData[i][1] < 0 ? -gWeaponData[i][1] : gWeaponData[i][1];
}
ResetPlayerWeapons(playerid);
for(new i; i != sizeof(gWeaponData); ++i)
{
if(gWeaponData[i][0] != weaponid)
{
GivePlayerWeapon(playerid, gWeaponData[i][0], gWeaponData[i][1]);
}
}
return 1;
}
pawn Код:
DeletePlayerWeapon(playerid, 28);