Help with this error
#6

Quote:
Originally Posted by ToiletDuck
Посмотреть сообщение
try
pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
    new dcbank[128];
    pBankInfo[playerid][PLAYER_INBANK] = 0;
        new Name[24]; GetPlayerName(playerid,Name,24);
        new file[100]; format(file,100,dcbank,Name);
        dini_IntSet(file,"Balance",pBankInfo[playerid][PLAYER_BALANCE]);
        dini_IntSet(file,"InBank",pBankInfo[playerid][PLAYER_INBANK]);
        return 1;
}
That didn't solve anything but supress the error.
DCbank holds an empty value and you're formatting your file to something empty.
I think you're better off using this:

pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
        new Name[24]; GetPlayerName(playerid,Name,24);
        new file[100]; format(file,100,"%s",Name);
        dini_IntSet(file,"Balance",pBankInfo[playerid][PLAYER_BALANCE]);
        dini_IntSet(file,"InBank",pBankInfo[playerid][PLAYER_INBANK]);  
        pBankInfo[playerid][PLAYER_INBANK] = 0;
        pBankInfo[playerid][PLAYER_BALANCE] = 0;        
        return 1;
}
That is, if you don't want broken code.
If you're not going to rename your file, you can remove the entire file array and just go with Name instead of the file.
Reply


Messages In This Thread
Help with this error - by djcabo - 28.07.2012, 23:06
Re: Help with this error - by ToiletDuck - 28.07.2012, 23:35
Re: Help with this error - by djcabo - 28.07.2012, 23:57
Re: Help with this error - by djcabo - 29.07.2012, 00:00
Re: Help with this error - by ToiletDuck - 29.07.2012, 00:00
Re: Help with this error - by Revo - 29.07.2012, 00:05
Re: Help with this error - by Private200 - 29.07.2012, 09:00

Forum Jump:


Users browsing this thread: 3 Guest(s)