how to save and load timer?!
#1

HI PEOPLE! how to save and load hospital time??!!

MYSQL R41-2

Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][pHospital] == 1)
	{
	    SetPlayerPos(playerid, 164.6683,211.3258,1003.5147);
	    korhaztimer[playerid] = SetTimerEx("exithospital", 60000, true, "d", playerid);
		SetPlayerHealth(playerid,100.0);
		pInfo[ playerid ][ pHospitalTimer ] = 60000;
	    pInfo[ playerid ][ pJatekosInti ] = 6;
	    SetPlayerInterior(playerid, 6);
	    SavePlayer(playerid);
	}

	PlayerDataLoad(playerid);
	return 1;
}
Reply
#2

You can replace the
korhaztimer[playerid] = SetTimerEx("exithospital", 60000, true, "d", playerid);
To
korhaztimer [playerid]=6;
And save it to a mysql variable in database then put the code on a timer of a second who repet
Ifkorhaztimer [playerid]>0;
Korhaztimer [playerid]--;// and save it to mysql

And don't forget to put at onplayerlogin the load variable from mysql database
Reply
#3

Can not you do it for me? Thank You!! I'm low scripter.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)