15.08.2013, 23:16
pawn Код:
dcmd_checkban(playerid,params[])
{
new string[128];
new tname[24];
new filestring[79];
if(sscanf(params,"s[24]",tname))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /checkban (Player Name)");
return 1;
}
format(filestring, sizeof(filestring), "/Users/%s.ini", tname);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "[ERROR] That player name does not exist in our database.");
if(fexist(filestring))
{
INI_ParseFile(filestring, "LoadUser_%s", .bExtra = false, .extra = playerid);
format(string, sizeof(string), "%s", PlayerInfo[tname][pBanReason]);
if(PlayerInfo[tname][pBanned] == 0)
{
format(string,sizeof(string),"[BAN CHECK] %s is not banned from the server",tname);
SendClientMessage(playerid, COLOR_RED,string);
return 1;
}
if(PlayerInfo[tname][pBanned] == 1)
{
format(string,sizeof(string),"[BAN CHECK] %s is currently banned from the server. [Reason: %s]",tname, PlayerInfo[tname][pBanReason]);
SendClientMessage(playerid, COLOR_RED,string);
return 1;
}
}
return 1;
}
error 033: array must be indexed (variable "tname")
error 033: array must be indexed (variable "tname")
error 033: array must be indexed (variable "tname")
error 033: array must be indexed (variable "tname")
Another question, how to loop through offline players, Y_INI also.