PHP Code:
IRCCMD:cookie(botid, channel[], user[], host[], params[])
{
new id, bString[128], cookies;
if(IRC_IsOp(botid, channel, user))
{
if(sscanf(params, "ui[24]", id,cookies))
{
IRC_Say(groupID, channel, "7Usage: 1!cookie [id] [cookies]");
return 1;
}
if(cookies < 1 && cookies > 100)
{
IRC_Say(groupID, channel, "Invalid Number [from 1 to 100 cookies]");
}
if(!IsPlayerConnected(id)) return IRC_Say(groupID, channel, "Invalid Player ID.");
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(id, pname, sizeof(pname));
format(bString, sizeof(bString), "You have given %s (ID: %d) %d cookies.",pname, id, cookies);
IRC_Say(groupID, channel, bString);
format(bString, sizeof(bString), "(#ZoneX) Admin %s given %s (ID: %d) %d cookies", user, pname, id, cookies);
SendClientMessage(id, COLOR_YELLOW, bString);
}
}
else return IRC_Say(groupID, channel, "7Error: 1You must be OP");
return 1;
}
PHP Code:
if(cookies < 1 && cookies > 100)
{
IRC_Say(groupID, channel, "Invalid Number [from 1 to 100 cookies]");
}
warning:
D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(7755) : warning 205: redundant code: constant expression is zero
PHP Code:
new id, bString[128], cookies;
Error:
D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(7747) : error 001: expected token: "-identifier-", but found "-integer value-"