My money dont save I dont know why
#1

On MY on player disconnect this happens
[pawn]
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File, "Tester",PlayerInfo[playerid][pTester]);
INI_WriteInt(File, "Guard",PlayerInfo[playerid][pGuard]);
INI_WriteInt(File, "Vip",PlayerInfo[playerid][pVip]);
INI_WriteInt(File, "Spawn",PlayerInfo[playerid][pSpawn]);
INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
INI_WriteInt(File, "Locked",PlayerInfo[playerid][pLocked]);
INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined]);
INI_WriteInt(File, "Sex", PlayerInfo[playerid][pSex]);
INI_WriteInt(File, "Age", PlayerInfo[playerid][pAge]);
INI_WriteInt(File, "Origin", PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp]);
INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns]);
INI_WriteInt(File, "Selected", PlayerInfo[playerid][pSelected]);
INI_WriteInt(File, "Continent", PlayerInfo[playerid][pPlace]);
INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted]);
INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime]);
INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber]);
INI_WriteInt(File, "DriveLic", PlayerInfo[playerid][pDriveLic]);
INI_Close(File);
return 1;
}[pawn]

On My On Player Connect
pawn Код:
GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
Reply
#2

INI_WriteInt(File, "Money",GetPlayerMoney(playerid));
Reply
#3

Quote:
Originally Posted by tyler12
Посмотреть сообщение
INI_WriteInt(File, "Money",GetPlayerMoney(playerid));
Where to add this?
Reply
#4

Anyone help fast? (rep +)
Reply
#5

Quote:
Originally Posted by Dare Devil.....
Посмотреть сообщение
Where to add this?
Where this is
pawn Код:
INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
Reply
#6

Its there under on player dissconect
Reply
#7

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File, "Money",GetPlayerMoney( playerid ));
INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File, "Tester",PlayerInfo[playerid][pTester]);
INI_WriteInt(File, "Guard",PlayerInfo[playerid][pGuard]);
INI_WriteInt(File, "Vip",PlayerInfo[playerid][pVip]);
INI_WriteInt(File, "Spawn",PlayerInfo[playerid][pSpawn]);
INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
INI_WriteInt(File, "Locked",PlayerInfo[playerid][pLocked]);
INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined]);
INI_WriteInt(File, "Sex", PlayerInfo[playerid][pSex]);
INI_WriteInt(File, "Age", PlayerInfo[playerid][pAge]);
INI_WriteInt(File, "Origin", PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp]);
INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns]);
INI_WriteInt(File, "Selected", PlayerInfo[playerid][pSelected]);
INI_WriteInt(File, "Continent", PlayerInfo[playerid][pPlace]);
INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted]);
INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime]);
INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber]);
INI_WriteInt(File, "DriveLic", PlayerInfo[playerid][pDriveLic]);
INI_Close(File);
return 1;
}
Reply
#8

Quote:
Originally Posted by Dare Devil.....
Посмотреть сообщение
Its there under on player dissconect
So it works? If your not seeing the difference it's that INI_WriteInt(File, "Money",GetPlayerMoney(playerid)); the bit in bold has been added to replace PlayerInfo[playerid][pCash].
Reply
#9

By taking Dare Devils advice to use GetPlayerMoney will make it possible to use money cheats in your server.
Reply
#10

I added this

INI_WriteInt(File, "Money",GetPlayerMoney( playerid ));

But now when I log off it saves the money into my stats file but I donot recive those money when I login
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)