public SendEMSQueue(playerid,type)
{
switch (type)
{
case 1:
{
Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
SetPVarInt(playerid, "EMSAttempt", -1);
if(GetPlayerInterior(playerid) > 0)
{
TogglePlayerControllable(playerid, 0);
SetPVarInt(playerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
}
GameTextForPlayer(playerid, "~r~Injured~n~~w~/accept death or /service ems", 5000, 3);
ClearAnimations(playerid);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid,0);
if(GetPVarInt(playerid, "usingfirstaid") == 1)
{
firstaidexpire(playerid);
}
SetPVarInt(playerid,"MedicCall",1);
}
case 2:
{
SetPVarInt(playerid,"EMSAttempt", 2);
ClearAnimations(playerid);
ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid,0);
}
}
return 1;
}
|
OnPlayerDeath is called when the player's health is 0 and there is no way to get it back, i suggest adding it under OnPlayerUpdate, get the player's health, if its =< 0.1 Send this!
|
new Float:hp;
GetPlayerHealth(playerid, hp);
if(hp =< 0.1)
{
//your codes
}
|
pawn Код:
|