25.03.2012, 03:29
How to make healing health like in other rp after you die your camera will set lookat hospital and you are healing yet
how to do that? i try this but failed
how to do that? i try this but failed
pawn Код:
new HealingTimer[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(IsPlayerDead[playerid] == 1)
{
SetPlayerHealth(playerid, 0.0);
SetPlayerVWIPosAng(playerid, 0, 0, 2012.0902,-1451.8118,13.5547,92.7932);
SetPlayerCamPosLookAt(playerid, 2010.6136,-1440.9576,13.6466, 2032.8142,-1408.2061,17.1641);
TogglePlayerControllable(playerid, false);
HealingTimer[playerid] = SetTimerEx("Healing", 1000, true, "i", playerid);
return 1;
}
return 1;
}
public Healing(playerid)
{
new Float:hp;
GetPlayerHealth(playerid, hp);
if(hp == 100.0)
{
if(GetPlayerMoney(playerid) > 100) {
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, COLOR_GREY, "Medical Bills: $100, You pay $100 to the doctor");
} else if(GetPlayerMoney(playerid) < 100) {
SendClientMessage(playerid, COLOR_GREY, "The Doctor heals you for free, because you do not have enough money to pay him!");
}
SetPlayerVWIPosAng(playerid, 0, 0, 2030.7820,-1407.5547,17.1802,164.7021);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, true);
}
SetPlayerHealth(playerid, hp + 1);
KillTimer(HealingTimer[playerid]);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerHealth(playerid, 0.0);
IsPlayerDead[playerid] = 1;
return 1;
}