25.12.2014, 14:29
Hello.
How can I do if when using / givegun and not put a parameter (eg / givegun ID) can not be used.
If yes / givegun defends his entire command id (id weapon bullets), I hope you understand.
I mean if you do not write complete command (/ givegun id weapon bullets) to the message does not appear again to be able to use the command
Excuse my English.
How can I do if when using / givegun and not put a parameter (eg / givegun ID) can not be used.
If yes / givegun defends his entire command id (id weapon bullets), I hope you understand.
I mean if you do not write complete command (/ givegun id weapon bullets) to the message does not appear again to be able to use the command
Excuse my English.
pawn Код:
if(strcmp(cmd, "/givegun", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 2)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SERVER, "Foloseste: {FFFFFF}/givegun [playerid] [weapon] [gloante]");
return 1;
}
new GunID;
new Ammo;
PlayerID = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
GunID = strval(tmp);
tmp = strtok(cmdtext, idx);
Ammo = strval(tmp);
if(IsPlayerConnected(PlayerID))
{
if(PlayerID != INVALID_PLAYER_ID)
{
GivePlayerWeapon(PlayerID, GunID, Ammo);
}
}
}
}
return 1;
}