Errors in my register system.
#7

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
pawn Код:
public OnGameModeExit()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            StopPlayerHoldingObject(i);

            if(isLogged[i] == 1)
            {
                new name[256], check[256];
                Delete3DTextLabel(levl[i]); // levl is not defined, maybe it's level?
                Delete3DTextLabel(admlabl[i]);
                GetPlayerName(i, name, sizeof(name));
                format(check, sizeof(check), "%s.ini", name);
                dini_IntSet(check,"kills", Kills[i]);
                dini_IntSet(check,"deaths", Deaths[i]);
                dini_IntSet(check,"money", GetPlayerMoney(i));
                dini_IntSet(check,"skill_deagle", Deagle[i]);
                dini_IntSet(check,"skill_shotgun", Shotgun[i]);
                dini_IntSet(check,"skill_spas", Spas[i]);
                dini_IntSet(check,"skill_mp5", MP5[i]);
                dini_IntSet(check,"skill_ak", Ak47[i]);
                dini_IntSet(check,"skill_m4", M4[i]);
                dini_IntSet(check,"skill_sniper", Sniper[i]);
                dini_IntSet(check,"SkillPoints", SkillPoints[i]);
                }
            }  
    }
    TextDrawDestroy(Textdraw);
    return 1;
}

But I suggest you to use something like this:
pawn Код:
stock SavePlayerData()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            StopPlayerHoldingObject(i);

            if(isLogged[i] == 1)
            {
                new name[256], check[256];
                Delete3DTextLabel(levl[i]); // levl is not defined, maybe it's level?
                Delete3DTextLabel(admlabl[i]);
                GetPlayerName(i, name, sizeof(name));
                format(check, sizeof(check), "%s.ini", name);
                dini_IntSet(check,"kills", Kills[i]);
                dini_IntSet(check,"deaths", Deaths[i]);
                dini_IntSet(check,"money", GetPlayerMoney(i));
                dini_IntSet(check,"skill_deagle", Deagle[i]);
                dini_IntSet(check,"skill_shotgun", Shotgun[i]);
                dini_IntSet(check,"skill_spas", Spas[i]);
                dini_IntSet(check,"skill_mp5", MP5[i]);
                dini_IntSet(check,"skill_ak", Ak47[i]);
                dini_IntSet(check,"skill_m4", M4[i]);
                dini_IntSet(check,"skill_sniper", Sniper[i]);
                dini_IntSet(check,"SkillPoints", SkillPoints[i]);
                }
            }  
    }
    TextDrawDestroy(Textdraw);
    return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/saveplayers", true) == 0)
    {
        SavePlayerData()
        return 1;
    }
    return 0;
}
If you typed /saveplayers, turn off the server.
Hm getting these errors:
Код:
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(281) : error 029: invalid expression, assumed zero
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(281) : error 017: undefined symbol "SavePlayerData"
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(292) : error 017: undefined symbol "levl"
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(292) : warning 215: expression has no effect
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(292) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(292) : error 029: invalid expression, assumed zero
C:\Documents and Settings\brian\Mijn documenten\Downloads\GTA San Andreas\gamemodes\Civil-War-TDM.pwn(292) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
on these lines:
pawn Код:
stock SavePlayerData()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            StopPlayerHoldingObject(i);

            if(isLogged[i] == 1)
            {
                new name[256], check[256];
Reply


Messages In This Thread
Errors in my register system. - by justsomeguy - 08.05.2011, 12:30
Re: Errors in my register system. - by Biesmen - 08.05.2011, 12:36
Re: Errors in my register system. - by trapped1 - 08.05.2011, 12:38
Re: Errors in my register system. - by justsomeguy - 08.05.2011, 12:48
Re: Errors in my register system. - by Biesmen - 08.05.2011, 12:58
Re: Errors in my register system. - by MadeMan - 08.05.2011, 13:30
Re: Errors in my register system. - by justsomeguy - 08.05.2011, 14:32
Re: Errors in my register system. - by Elka_Blazer - 08.05.2011, 14:41
Re: Errors in my register system. - by justsomeguy - 08.05.2011, 15:14
Re: Errors in my register system. - by justsomeguy - 09.05.2011, 10:50

Forum Jump:


Users browsing this thread: 1 Guest(s)