24.06.2010, 09:39
Hey guys, I'm making a /warn command for admins.... And I need to check the next unused warn slot in the player file.
The player can have up to 5 warnings... but this doesn't work to check:
I get following errors:
Can anyone correct this and post the working one or tell me how to do and i'll do it please?
Thank you
The player can have up to 5 warnings... but this doesn't work to check:
pawn Код:
dcmd_warn(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return 1;
new id,warn[128], string[128], string2[128];
if(sscanf(params, "u", id)) return SendHelpMessage(playerid, ".: Usage: /warn [playerid/partofname] [warning] :.");
if(id == INVALID_PLAYER_ID) return SendErrorMessage(playerid, ".: Info: Player not found :.");
format(string,sizeof(string),"* %s %s has warned %s [%d/5]. Reason: %s *",AdminRankName(playerid),pName(playerid),pName(id),PlayerInfo[id][pWarnings],warn);
format(string2,sizeof(string2),"%s %s",date(),string);
SendClientMessageToAll(COLOR_DARKRED,string);
new File:Warns = fopen("logs/warns.txt", io_append);
fwrite(Warns,string2);
fclose(Warns);
if(dini_Get(Playerfile(id),"Warn1") == 0)
{
dini_Set(Playerfile(id),"Warn1",warn);
return 1;
}
if(dini_Get(Playerfile(id),"Warn2") == 0)
{
dini_Set(Playerfile(id),"Warn2",warn);
return 1;
}
if(dini_Get(Playerfile(id),"Warn3") == 0)
{
dini_Set(Playerfile(id),"Warn3",warn);
return 1;
}
if(dini_Get(Playerfile(id),"Warn4") == 0)
{
dini_Set(Playerfile(id),"Warn4",warn);
return 1;
}
if(dini_Get(Playerfile(id),"Warn5") == 0)
{
dini_Set(Playerfile(id),"Warn5",warn);
return 1;
}
return 1;
}
Код:
D:\Documents and Settings\IntrozeN.MORSE\Desktop\SAMP Server\gamemodes\Testserver.pwn(642) : error 033: array must be indexed (variable "dini_Get") D:\Documents and Settings\IntrozeN.MORSE\Desktop\SAMP Server\gamemodes\Testserver.pwn(647) : error 033: array must be indexed (variable "dini_Get") D:\Documents and Settings\IntrozeN.MORSE\Desktop\SAMP Server\gamemodes\Testserver.pwn(652) : error 033: array must be indexed (variable "dini_Get") D:\Documents and Settings\IntrozeN.MORSE\Desktop\SAMP Server\gamemodes\Testserver.pwn(657) : error 033: array must be indexed (variable "dini_Get") D:\Documents and Settings\IntrozeN.MORSE\Desktop\SAMP Server\gamemodes\Testserver.pwn(662) : error 033: array must be indexed (variable "dini_Get")
Thank you