Код:
ptask EMSUpdate[5000](playerid)
{
if(GetPVarType(playerid, "Injured"))
{
if(GetPVarInt(playerid, "EMSAttempt") != 0)
{
new Float:health;
GetPlayerHealth(playerid,health);
SetPlayerHealth(playerid, health-1);
if(GetPVarInt(playerid, "EMSAttempt") == -1)
{
if(GetPlayerAnimationIndex(playerid) != 746) ClearAnimations(playerid), ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
GameTextForPlayer(playerid, "~r~Injured~n~~w~/service ems", 5000, 3);
}
if(GetPVarInt(playerid, "EMSAttempt") == 1)
{
if(GetPlayerAnimationIndex(playerid) != 746) ClearAnimations(playerid), ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
GameTextForPlayer(playerid, "~r~Injured~n~~w~Waiting for EMS to Arrive...", 5000, 3);
}
if(GetPVarInt(playerid, "EMSAttempt") == 2)
{
GameTextForPlayer(playerid, "~g~Rescued~n~~w~Awaiting Treatment...", 5000, 3);
}
if(GetPVarInt(playerid, "EMSAttempt") == 3)
{
if(IsPlayerInAnyVehicle(playerid))
{
new ambmodel = GetPlayerVehicleID(playerid);
if(IsAnAmbulance(ambmodel) || IsATierraESCar(ambmodel))
{
GameTextForPlayer(playerid, "~g~Rescued~n~~w~Waiting for EMS to take to Hospital...", 5000, 3);
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "You fell unconscious due to no life support, you were immediately sent to the hospital.");
KillEMSQueue(playerid);
SpawnPlayer(playerid);
TogglePlayerBurning(playerid, false);
}
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "You fell out of the vehicle, the Paramedics will have to try harder.");
}
}
GetPlayerHealth(playerid, health);
if(health <= 5)
{
SendClientMessageEx(playerid, COLOR_WHITE, "You fell unconscious, you were immediately sent to the hospital.");
KillEMSQueue(playerid);
SpawnPlayer(playerid);
TogglePlayerBurning(playerid, false);
}
}
}
}
I simply not read the whole code.
Explain with more words what do you wanna do "here" to need a loop or a timer.