04.05.2015, 12:51
Quote:
Try this.
PHP код:
|
"weaponid" is 0 because it has not been updated with sscanf (it should be before the check):
PHP код:
CMD:givegun(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessageEx(playerid, COLOR_RED, " You are not authorized to use that command !");
new giveplayerid, weaponid;
if(sscanf(params, "ud", giveplayerid, weaponid)) return SendClientMessage(playerid, COLOR_WHITE, "Syntax:givegun [player] [weaponid]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessageEx(playerid, COLOR_RED, "Offline player");
if(!(0 <= weaponid <= 46)) return SendClientMessageEx(playerid, COLOR_RED, "Invalid weaponid");
if(weaponid == 38) return SendClientMessageEx(playerid, COLOR_RED, "You cannot give anyone a minigun!");
GivePlayerGun(giveplayerid, weaponid, 50);
return 1;
}