13.10.2012, 18:49
Hello,im trying to make an /unban command to unban a player account:
I use pInfo.
The variables are:
pBanned
PlayerInfo[playerid][pBanned]
When i compile with that command,i get this errors:
Line 3621:
Line 3629:
Thank you for the help.
pawn Код:
CMD:unban(playerid,params[])
{
new name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdmin] < 5) return 0;
if(sscanf(params,"s[MAX_PLAYER_NAME]",name)) return SendClientMessage(playerid, -1, "Usage: /unban [player name]");
if(strlen(name) > 24) return SendClientMessage(playerid, red, "The Player Name Must Be Less Than 60 Characters Long.");
new string[98];
format(string,sizeof(string),"/Users/%s.ini",name);
new IsBanned;
new INI:File = INI_Open(UserPath(playerid));
{
INI_Int("Banned");
}
if(IsBanned == 0) return SendClientMessage(playerid, red, "This player account is not banned.");
if(!fexist(string)) return SendClientMessage(playerid, red, "Player account not found, please note the files are CASE SENSITIVE.");
INI_WriteInt(File,"Banned",0);
INI_Close(File);
format(string,sizeof(string),"Player account %s has been unbanned.",name);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string,sizeof(string),"Admin %s has unbanned the player account: %s.",name(playerid),name);
return 1;
}
The variables are:
pBanned
PlayerInfo[playerid][pBanned]
When i compile with that command,i get this errors:
Quote:
C:\Documents and Settings\\Desktop\Cops&Robbers\gamemodes\.pwn(3621 ) : error 017: undefined symbol "INI_Int" C:\Documents and Settings\\Desktop\Cops&Robbers\gamemodes\.pwn(3629 ) : error 012: invalid function call, not a valid address C:\Documents and Settings\\Desktop\Cops&Robbers\gamemodes\.pwn(3629 ) : warning 215: expression has no effect C:\Documents and Settings\\Desktop\Cops&Robbers\gamemodes\.pwn(3629 ) : error 001: expected token: ";", but found ")" C:\Documents and Settings\\Desktop\Cops&Robbers\gamemodes\.pwn(3629 ) : error 029: invalid expression, assumed zero C:\Documents and Settings\\Desktop\Cops&Robbers\gamemodes\.pwn(3629 ) : fatal error 107: too many error messages on one line |
pawn Код:
INI_Int("Banned");
pawn Код:
format(string,sizeof(string),"Admin %s has unbanned the player account: %s.",name(playerid),name);