SA-MP Forums Archive
HELP FAST - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP FAST (/showthread.php?tid=557563)



HELP FAST - aCloudy - 14.01.2015

Hello.
Can someone do auto-save for me ? I mean auto-save OnPlayerDisconnect:



Код:
    dUserSetINT(PlayerName(playerid)).("Money",GetPlayerMoney(playerid));
		dUserSetINT(PlayerName(playerid)).("Bankcash",BankCash[playerid]);
		dUserSetINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid));
		dUserSetINT(PlayerName(playerid)).("Adminlevel",AdminLevel[playerid]);
		dUserSetINT(PlayerName(playerid)).("Helperlevel",HelperLevel[playerid]);
		dUserSetINT(PlayerName(playerid)).("VIP",IsVIP[playerid]);
		dUserSetINT(PlayerName(playerid)).("HasPins",HasBP[playerid]);
		dUserSetINT(PlayerName(playerid)).("MMs",HasMM[playerid]);
		dUserSetINT(PlayerName(playerid)).("Scissors",HasScissors[playerid]);
		dUserSetINT(PlayerName(playerid)).("Ropes",HasRope[playerid]);
		dUserSetINT(PlayerName(playerid)).("ButtPlugs",BP[playerid]);
		dUserSetINT(PlayerName(playerid)).("WantedLevel",GetPlayerWantedLevel(playerid));
		dUserSetINT(PlayerName(playerid)).("SavedJailTime",JailTime[playerid]);
		dUserSetINT(PlayerName(playerid)).("XP",PlayerXP[playerid]);
		dUserSetINT(PlayerName(playerid)).("HitMoney",HitMoney[playerid]);
		dUserSetINT(PlayerName(playerid)).("IP",GetPlayerIp(playerid,ip,50));
		dUserSetINT(PlayerName(playerid)).("Arrests",Arrests[playerid]);
		dUserSetINT(PlayerName(playerid)).("Robberies",Robberies[playerid]);
		dUserSetINT(PlayerName(playerid)).("Kills",Kills[playerid]);
		dUserSetINT(PlayerName(playerid)).("Deaths",Deaths[playerid]);
		dUserSetINT(PlayerName(playerid)).("C4s",HasC4[playerid]);



Re: HELP FAST - Ironboy - 14.01.2015

Make a stock for it.


Re: HELP FAST - aCloudy - 14.01.2015

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
Make a stock for it.
Can someone make a stock for me please ?!


Re: HELP FAST - Ironboy - 14.01.2015

pawn Код:
stock SavePlayerdata(playerid)
{
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    dUserSetINT(PlayerName(playerid)).("Money",GetPlayerMoney(playerid));
    dUserSetINT(PlayerName(playerid)).("Bankcash",BankCash[playerid]);
    dUserSetINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid));
    dUserSetINT(PlayerName(playerid)).("Adminlevel",AdminLevel[playerid]);
    dUserSetINT(PlayerName(playerid)).("Helperlevel",HelperLevel[playerid]);
    dUserSetINT(PlayerName(playerid)).("VIP",IsVIP[playerid]);
    dUserSetINT(PlayerName(playerid)).("HasPins",HasBP[playerid]);
    dUserSetINT(PlayerName(playerid)).("MMs",HasMM[playerid]);
    dUserSetINT(PlayerName(playerid)).("Scissors",HasScissors[playerid]);
    dUserSetINT(PlayerName(playerid)).("Ropes",HasRope[playerid]);
    dUserSetINT(PlayerName(playerid)).("ButtPlugs",BP[playerid]);
    dUserSetINT(PlayerName(playerid)).("WantedLevel",GetPlayerWantedLevel(playerid));
    dUserSetINT(PlayerName(playerid)).("SavedJailTime",JailTime[playerid]);
    dUserSetINT(PlayerName(playerid)).("XP",PlayerXP[playerid]);
    dUserSetINT(PlayerName(playerid)).("HitMoney",HitMoney[playerid]);
    dUserSetINT(PlayerName(playerid)).("IP",GetPlayerIp(playerid,ip,50));
    dUserSetINT(PlayerName(playerid)).("Arrests",Arrests[playerid]);
    dUserSetINT(PlayerName(playerid)).("Robberies",Robberies[playerid]);
    dUserSetINT(PlayerName(playerid)).("Kills",Kills[playerid]);
    dUserSetINT(PlayerName(playerid)).("Deaths",Deaths[playerid]);
    dUserSetINT(PlayerName(playerid)).("C4s",HasC4[playerid]);
}
pawn Код:
SavePlayerdata(playerid); //use this in OnPlayerDisconnect callback but this wont check if the player is logged in or not



Re: HELP FAST - aCloudy - 14.01.2015

Fixed.
Thank you