03.03.2015, 19:29
No problem. Well as you can see this is my code so far:
but I am getting these errors, I don't know if i've wrote the command right or not
pawn Код:
ACMD:ban(playerid, params[])
{
if (pInfo[playerid][Adminlevel] < 2)return 0;
new reason[128];
if(sscanf(params, "us[128]",ID, reason))
return SCM(playerid, orange, "Ban a player: /ban <ID> <Reason>");
if(ID == IPI)return SCM(playerid, red, "Player is not connected!");
GetPlayerName(playerid,pName,sizeof(pName)); //Get player's name
if(fexist(bPath(playerid)))
new INI:file = INI_Open(bPath(playerid));
INI_WriteInt(file,"BanReason", bInfo[playerid][BanReason]);
INI_WriteInt(file, "BanAdmin", bInfo[playerid][BanAdmin]);
INI_Close(file);
GetPlayerName(ID,pName,MAX_PLAYER_NAME);
GetPlayerName(playerid,pName, MAX_PLAYER_NAME);
SetTimerEx("KickTimer", 10, false, "i", playerid);
format(ustr, sizeof(ustr), "%s %s has banned %s for %s", AdminLevelName(playerid),pName, pName, reason);
SCMToAll(red, ustr);
SetTimerEx("KickTimer", 1000, false, "d", playerid);
return 1;
}
pawn Код:
enum banInfo
{
BanReason,
BanAdmin,
}
new bInfo[MAX_PLAYERS][banInfo];
stock bPath(playerid)
{
GetPlayerName(playerid,pName,sizeof(pName));
format(ustr,sizeof(ustr),UserPath,pName);
return ustr;
}
Код:
C:\Users\BLACK\Desktop\Test\filterscripts\Accounts1.0.pwn(1637) : error 003: declaration of a local variable must appear in a compound block C:\Users\BLACK\Desktop\Test\filterscripts\Accounts1.0.pwn(1637) : warning 221: label name "INI" shadows tag name C:\Users\BLACK\Desktop\Test\filterscripts\Accounts1.0.pwn(1637) : error 017: undefined symbol "file" C:\Users\BLACK\Desktop\Test\filterscripts\Accounts1.0.pwn(1638) : error 017: undefined symbol "file" C:\Users\BLACK\Desktop\Test\filterscripts\Accounts1.0.pwn(1639) : error 017: undefined symbol "file" C:\Users\BLACK\Desktop\Test\filterscripts\Accounts1.0.pwn(1640) : error 017: undefined symbol "file"