02.06.2010, 15:02
Hello,
I am really angry of this shit xD I got again a problem about the money.
-->When I give me money it shows my that my money is increasing but when I type /stats I donґt see my actual money. It shows me the moeny I have before I give me money.
And when I disconnect the money wonґt save -.-
ANd sure when I connect the money which is in my user file appears.
Can somebody, somebody who knows the problem help me?? I can give him all he want. Credits on my server and so on but HELP ME xDDD
I am really angry of this shit xD I got again a problem about the money.
-->When I give me money it shows my that my money is increasing but when I type /stats I donґt see my actual money. It shows me the moeny I have before I give me money.
And when I disconnect the money wonґt save -.-
ANd sure when I connect the money which is in my user file appears.
Can somebody, somebody who knows the problem help me?? I can give him all he want. Credits on my server and so on but HELP ME xDDD
pawn Код:
forward SetPlayerMoney(playerid,amount);
pawn Код:
public OnPlayerConnect(playerid)
{
if(dini_Exists(PlayerFile))
{
if(playerIP[50] == playerIp[49])
{
SendClientMessage(playerid, COLOR_GREEN, "You have been automatically logged in! Welcome back to the server.");
PlayerInfo[playerid][Registered] = 1;
PlayerInfo[playerid][LoggedIn] = 1;
PlayerInfo[playerid][AdminLevel] = dini_Int(PlayerFile, "AdminLevel");
PlayerInfo[playerid][Kills] = dini_Int(PlayerFile, "Kills");
PlayerInfo[playerid][Deaths] = dini_Int(PlayerFile, "Deaths");
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, dini_Int(PlayerFile,"Money"));
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], PlayerFile[50];
GetPlayerName(playerid,name,sizeof(name));
format(PlayerFile,sizeof(PlayerFile),"/users/%s.ini",name);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, dini_Int(PlayerFile,"Money"));
pawn Код:
public SetPlayerMoney(playerid,amount)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,amount);
return 1;
}
public OnPlayerUpdate(playerid)
{
new PlayerFile[128];
format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", playerid);
GivePlayerMoney(playerid, dini_Int(PlayerFile,"Money"));
}