05.11.2009, 23:36
Hi, I would like to know how to block player slot arms(weapons slot) .. Eg. I have a command (/ak47), which gives the weapon. I now want that the player can not change it for sale only after /drop weapon.
new GunCode[MAX_PLAYERS];
GunCode[playerid] = 1;
if(GunCode[playerid] == 1) { SendClientMessage(playerid, color, "You cant give this away!"); return 1; } else { // The regular code. return 1; }
{ ResetPlayerWeapons(playerid); GunCode=0; }
Originally Posted by retart441
Just do the simple thing and create a new variable.
Код:
new GunCode[MAX_PLAYERS]; Код:
GunCode[playerid] = 1; Код:
if(GunCode[playerid] == 1) { SendClientMessage(playerid, color, "You cant give this away!"); return 1; } else { // The regular code. return 1; } Код:
{ ResetPlayerWeapons(playerid); GunCode=0; } |
Originally Posted by Blaze09
Unnecessary resetting the player's weapons, what if they have more than one weapon?
You can just set the player's ammo for that weapon to 0. |
{ SetPlayerAmmo(playerid, 1, 0); GunCode=0; }
Originally Posted by Logitech334
Sory, wrong is. I do not mean exactly that. I would like to do this so that if a player has a weapon it can not switch it on "sale" just must have that weapon until you use the / drop
. |