Checking next unused warning slot.... help please
#1

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:

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;
    }
I get following errors:

Код:
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")
Can anyone correct this and post the working one or tell me how to do and i'll do it please?

Thank you
Reply


Messages In This Thread
Checking next unused warning slot.... help please - by introzen - 24.06.2010, 09:39
Re: Checking next unused warning slot.... help please - by introzen - 24.06.2010, 19:22
Re: Checking next unused warning slot.... help please - by Finn - 24.06.2010, 19:34
Re: Checking next unused warning slot.... help please - by [HiC]TheKiller - 24.06.2010, 20:08

Forum Jump:


Users browsing this thread: 2 Guest(s)