03.05.2015, 16:26
hello im getting an error in my /givegun command.
i try to make so that no one is allowed to give some weapons like Knife and Minigun, (maybe more)
this is my command:
Errors:
i try to make so that no one is allowed to give some weapons like Knife and Minigun, (maybe more)
this is my command:
Код:
CMD:givegun(playerid, params[])
{
new giveplayerid, wepID, ammo, weapon[50], string[128];
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
if(sscanf(params, "ud", giveplayerid, wepID, ammo)) SendClientMessage(playerid, COLOR_RED, "[USAGE]: /givegun [name/id] [weapon id] [ammo]");
if(PlayerInfo[playerid][pGuns] = 4 && PlayerInfo[playerid][pGuns] = 38)<<< Line2234
{
SendClientMessageEx(playerid, COLOR_RED, "You are not allowed to give a knife,minigun!");
return 1;
}
if(wepID < 1 || wepID > 46) SendClientMessage(playerid, COLOR_RED, "Invalid weapon id.");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
if(giveplayerid == playerid)
{
GetWeaponName(wepID, (weapon), sizeof(weapon));
GivePlayerWeapon(playerid, wepID, ammo);
format(string, sizeof(string), "You have given yourself a %s with %d ammo.", weapon, ammo);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else
{
GetWeaponName(wepID, (weapon), sizeof(weapon));
format(string, sizeof(string), "You have given %s [%d] a %s with %d ammo.", pName(giveplayerid), giveplayerid, weapon, ammo);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Admin %s [%d] has given you a %s with %d ammo.", pName(playerid), playerid, weapon, ammo);
SendClientMessage(giveplayerid, COLOR_LIGHTGREEN, string);
GivePlayerWeapon(giveplayerid, wepID, ammo);
new astring[100];
format(astring, sizeof(astring), "Admin %s [%d] has given %s [%d] a %s with %d ammo.", pName(playerid), playerid, pName(giveplayerid), giveplayerid, weapon, ammo);
SendAdminMessage(COLOR_GREY, astring);
}
return 1;
}
Код:
(2234) : warning 211: possibly unintended assignment (2234) : warning 211: possibly unintended assignment (2234) : error 022: must be lvalue (non-constant) (2234) : warning 215: expression has no effect (2234) : error 001: expected token: ";", but found ")" (2234) : error 029: invalid expression, assumed zero (2234) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.


