When someone dies it sends them straight to hospital ?
#1

what i mean is , when someone dies on my roleplay server it says /accept death etc , however after few seconds it sends them to hospital
Reply
#2

First you should make random spawns(the Hospitals) then add it after the Countdown Code
Reply
#3

// TickRate: 5 secs.
Timer:EMSUpdate[5000]()
{
foreach(Player, i)
{
if(GetPVarType(i, "Injured"))
{
if(GetPVarInt(i, "EMSAttempt") != 0)
{

new Float:health;
GetPlayerHealth(i,health);
SetPlayerHealth(i, health-1);
if(GetPVarInt(i, "EMSAttempt") == -1)
{
if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
{
SendClientMessageEx(i, COLOR_WHITE, "You fell unconscious, you were immediately sent to the hospital.");
KillEMSQueue(i);
SpawnPlayer(i);
}
GameTextForPlayer(i, "~r~Injured~n~~w~/accept death or /service ems", 5000, 3);
}
if(GetPVarInt(i, "EMSAttempt") == 1)
{
if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
{
SendClientMessageEx(i, COLOR_WHITE, "You fell unconscious, you were immediately sent to the hospital.");
KillEMSQueue(i);
SpawnPlayer(i);
}
GameTextForPlayer(i, "~r~Injured~n~~w~Waiting for EMS to Arrive...", 5000, 3);
}
if(GetPVarInt(i, "EMSAttempt") == 2)
{
if(!IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")))
{
SendClientMessageEx(i, COLOR_WHITE, "You fell unconscious, you were immediately sent to the hospital.");
KillEMSQueue(i);
SpawnPlayer(i);
}
GameTextForPlayer(i, "~g~Rescued~n~~w~Awaiting Treatment...", 5000, 3);
}
if(GetPVarInt(i, "EMSAttempt") == 3)
{
if(IsPlayerInAnyVehicle(i))
{
new ambmodel = GetPlayerVehicleID(i);
if(IsAnAmbulance(ambmodel) || IsATierraESCar(ambmodel))
{
GameTextForPlayer(i, "~g~Rescued~n~~w~Waiting for EMS to take to Hospital...", 5000, 3);
}
else
{
SendClientMessageEx(i, COLOR_WHITE, "You fell unconscious due to no life support, you were immediately sent to the hospital.");
KillEMSQueue(i);
SpawnPlayer(i);
}
}
else
{
SendClientMessageEx(i, COLOR_WHITE, "You fell out of the vehicle, you were immediately sent to the hospital.");
KillEMSQueue(i);
SpawnPlayer(i);
}
}

GetPlayerHealth(i, health);
if(health <= 5)
{
SendClientMessageEx(i, COLOR_WHITE, "You fell unconscious, you were immediately sent to the hospital.");
KillEMSQueue(i);
SpawnPlayer(i);
}
}
}
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)