25.01.2014, 20:39
Hello i made a temp ban command and now it says that something is not defined and i dont know why
here is my code
and here are the errors
here is my code
pawn Код:
CMD:tempbanip(playerid,params[])
{
if(pInfo[playerid][Adminlevel] >= 3)
new ip[16];
new days;
if(GetCurrentTempBanCount() == 24) return SendClientMessage(playerid,COLOR_RED,"Temp Ban Limit Reached.");
if(sscanf(params, "s[16]d",ip,days)) return SendClientMessage(playerid,COLOR_RED,"Usage: /tempbanip <ip> <amount of days ahead>");
new year,mon,d;
getdate(year,mon,d);
new i = GetTempBanSlot();
TempBans[i][BannedIP] = ip;
TempBans[i][UnbanDate] = d+days;
new str[100];
format(str,sizeof str,"** IP %s set to to unbanned on %d/%d/%d",mon,d+days,year);
SendClientMessage(playerid,COLOR_RED,str);
format(str,sizeof str,"banip %s",ip);
SendRconCommand(str);
return 1;
}
Код:
freeroam.pwn(2977) : error 003: declaration of a local variable must appear in a compound block freeroam.pwn(2977) : error 017: undefined symbol "ip" freeroam.pwn(2977) : warning 215: expression has no effect freeroam.pwn(2977) : error 001: expected token: ";", but found "]" freeroam.pwn(2977) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. <<< Process finished. (Exit code 1) ================ READY ================