Death Timer scripting Help please
#1

Okay so Im trying to figure out how to set the timer for when you get shot you re-spawn in that location and wait for EMS to come treat you.. Right now the EMS/FD is working but the only problem is when someone kill you, You spawn in the hospital right away.. How do i set the timer so you have time to wait for EMS/FD before bleeding out.

Here is my code i think.. i think this what i need to change :/

Код:
if(MedicTime[playerid] > 0)
	{
		if(MedicTime[playerid] == 3)
		{
			SetPlayerInterior(playerid, 5);
			new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X,Y,Z);
			SetPlayerCameraPos(playerid, X + 3, Y, Z);
			SetPlayerCameraLookAt(playerid,X,Y,Z);
		}
		MedicTime[playerid] ++;
		if(MedicTime[playerid] >= NeedMedicTime[playerid])
		{
			new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
			GivePlayerCash(playerid, -cut);
			format(string, sizeof(string), "Hospital: Your medical bill comes to $%d, have a nice day.", cut);
			SendClientMessageEx(playerid, TEAM_CYAN_COLOR, string);
			TogglePlayerControllable(playerid, 1);
			SetPVarInt(playerid, "MedicBill", 0);
			MedicTime[playerid] = 0;
			NeedMedicTime[playerid] = 0;
			SpawnPlayer(playerid);
		}
	}
Im new to scripting!
P.S This my first post so Sorry in advance if i posted in the wrong format..
Reply
#2

This might help you.

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#3

Thanks for the fast reply, Im very new to scripting and just learning how to edit.. After reading the link you have me i still have no idea what to change, Would this have anything to do with it ?
Код:
 else if(type == TYPE_HOSPITALTIMER)
	{
	    if(GetPVarInt(playerid, "HospitalTimer") > 0)
		{
		    new Float:curhealth;
			GetPlayerHealth(playerid, curhealth);
			SetPVarInt(playerid, "HospitalTimer", GetPVarInt(playerid, "HospitalTimer")-1);
			SetPlayerHealth(playerid, curhealth+1);
			SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_HOSPITALTIMER);
			if(GetPVarInt(playerid, "HospitalTimer") == 0)
			{
				HospitalSpawn(playerid);
Reply
#4

Код:
 SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_HOSPITALTIMER);
Try changing it from false to true, see if that works.
Reply
#5

Quote:
Originally Posted by BrianSan
Посмотреть сообщение
Код:
 SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_HOSPITALTIMER);
Try changing it from false to true, see if that works.
I think the true and false is for if you want the timer to keep repeating or not.. But ill try anyway aha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)