25.09.2009, 13:54
Quote:
|
Originally Posted by wil2140
Hey Jafri!
I don't know what type of file system you have or if you have a login system, but something like this is easy to do with dini. You'll need to download the dini include. Something like this would work: Save the pcash on disconnect Код:
public OnPlayerDisconnect(playerid, reason)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "%s.ini", pname);
if(!dini_Exists(file))
{
dini_Create(file);
}
dini_IntSet(file, "PCash", GetPlayerPCash(playerid));
ResetPlayerPCash(playerid); //reset Pcash for security
return 1;
}
Код:
public OnPlayerConnect(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "%s.ini", pname);
if(dini_Exists(file))
{
GivePlayerPCash(playerid, dini_Int(file, "PCash"));
}
return 1;
}
|
I'm Using LA:RP Script. So i think this might work
Also i am Jafri's Cousin I'm using his account for now.

