Server Closed connection
#8

His was actually correct. Apart from not checking weapon IDs 19-21 (Invalid weapon IDs), his code was perfect.

He never had '0 <= 0 weaponid', that was your mistake.

pawn Код:
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;
}
Reply


Messages In This Thread
Server Closed connection - by IndependentGaming - 04.05.2015, 12:20
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:47
Re: Server Closed connection - by giorgosdim12 - 04.05.2015, 12:48
Re: Server Closed connection - by Karan007 - 04.05.2015, 12:49
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:50
Re: Server Closed connection - by Konstantinos - 04.05.2015, 12:51
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:56
Re: Server Closed connection - by Threshold - 04.05.2015, 12:58
Re: Server Closed connection - by IndependentGaming - 04.05.2015, 12:59

Forum Jump:


Users browsing this thread: 1 Guest(s)