05.04.2015, 09:20
Hello . I want that when the player makes a command , it give him a weapon . But I want the weapon that had previously be saved because when the player redo the command ,he get back to him.
This is my code but the weapon will not given back.
Can you help me? Thank you!
pawn Код:
CMD:weap(playerid, params[])
{
new Weap[2];
new Pick[MAX_PLAYERS];
if(Pick[playerid] == 0)
{
Pick[playerid] = 1;
GetPlayerWeaponData(playerid, 2, Weap[0], Weap[1]);
SendClientMessageEx(playerid, -1, "Message.");
GivePlayerWeapon(playerid, 23, cellmax);
SetPlayerArmedWeapon(playerid, 23);
}
else if(Pick[playerid] == 1)
{
Pick[playerid] = 0;
SetPlayerAmmo(playerid, 23, 0);
GivePlayerWeapon(playerid, Weap[0], Weap[1]);
SendClientMessageEx(playerid, -1, "Message.");
}
return 1;
}
Can you help me? Thank you!