Quote:
Originally Posted by iggy1
Wrote a couple of functions for you, the names should be enough to tell you what they do.
pawn Код:
enum WEP_DAT { e_iWeapons[13], e_iAmmo[13], };
new gPlayerWeaponData[MAX_PLAYERS][WEP_DAT];
RemoveWeapons(playerid) { for(new i; i < 13; i++) GetPlayerWeaponData(playerid, i, gPlayerWeaponData[playerid][e_iWeapons][i], gPlayerWeaponData[playerid][e_iAmmo][i]);
ResetPlayerWeapons(playerid);//this function disarms players }
GiveBackWeapons(playerid) { for(new i; i < 13; i++) GivePlayerWeapon(playerid, gPlayerWeaponData[playerid][e_iWeapons][i], gPlayerWeaponData[playerid][e_iAmmo][i]); }
|
First, add that to your script.
Second, look at your code
pawn Код:
// Deathmatch Command
ResetWeapons( playerid );
// GivePlayerWeapon, blablablabla
pawn Код:
// Leave Deathmatch Command
ResetPlayerWeapons( playerid );
GiveBackWeapons( playerid );