16.09.2017, 15:42
PHP код:
makePlayerDying(playerid) {
if(isPlayerDying(playerid)) {
finishDying(playerid);
putPlayerInHospital(playerid);
return 1;
}
if(GetPVarType(playerid, "MedicTimer") == PLAYER_VARTYPE_NONE) {
new Timer:timer = repeat medicDeathTimer(playerid);
SetPVarInt(playerid, "MedicTimer", _:timer);
}
GameTextForPlayer(playerid, "~r~Injured.~n~~w~Do /accept death or /service EMS",8000, 5);
loadSpecDetails(playerid);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
SetPlayerHealthEx(playerid, 98.0);
return 0;
}
revivePlayer(playerid) {
new Timer:timer = Timer:GetPVarInt(playerid, "MedicTimer");
stop timer;
new Float:HP;
GetPlayerHealth(playerid, HP);
if(HP < 15.0) {
HP = 15.0;
} else {
HP += 15.0;
}
SetPlayerHealthEx(playerid, HP);
ClearAnimations(playerid);
TogglePlayerControllableEx(playerid, 1);
DeletePVar(playerid, "MedicTimer");
}
PHP код:
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);