if(weaponid == 38) return SendClientMessageEx(playerid, COLOR_RED, "You cannot give anyone a minigun!");
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(weaponid == 38) return SendClientMessageEx(playerid, COLOR_RED, "You cannot give anyone a minigun!");
if(sscanf(params, "ud", giveplayerid, weaponid))
{
SendClientMessage(playerid, COLOR_WHITE, "Syntax:givegun [player] [weaponid]");
}
GivePlayerGun(giveplayerid, weaponid, 50);
return 1;
}
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(weaponid == 38) return SendClientMessageEx(playerid, COLOR_RED, "You cannot give anyone a minigun!");
if(sscanf(params, "ud", giveplayerid, weaponid))
{
SendClientMessage(playerid, COLOR_WHITE, "Syntax:givegun [player] [weaponid]");
}
return 1;
}
Try this.
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;
}
(2265) : error 001: expected token: ")", but found "-identifier-"
(2265) : error 029: invalid expression, assumed zero
(2265) : warning 215: expression has no effect
(2265) : error 001: expected token: ";", but found "return"
(2265) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
if(!(0 <= 0 weaponid <= 46)) return SendClientMessageEx(playerid, COLOR_RED, "Invalid weaponid");
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 <= 18 || 22 <= 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;
}