help me fix onplayerdeath
#9

pawn Код:
public OnPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pHospitalCured] == 0)
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerPos(playerid, PlayerInfo[pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pFacingAngle]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
}
else if(PlayerInfo[playerid][pHospitalCured] >= 1)
{
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], 1606.77, 1820.03, 10.83, 270, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
PlayerInfo[playerid][pHospitalized] = 0;
TogglePlayerSpectating(playerid, true);
}
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[playerid][pHospitalized] >= 0)
{
SetTimer("Hospitalized", 5000, false);
GameTextForPlayer(playerid, "~r~Being transfered to Las Venturas Hospital..", 9000, 4);
RemovePlayerFromVehicle(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pPositionX], PlayerInfo[playerid][pPositionY], PlayerInfo[playerid][pPositionZ]);
}
return 1;
}
forward Hospitalized(playerid);
public Hospitalized(playerid)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 9);
SetPlayerCameraPos(playerid, 1583.90, 1847.44, 17.89);
SetPlayerCameraLookAt(playerid, 1606.14, 1825.32, 10.82);
GameTextForPlayer(playerid, "~r~The Doctor is curing you...~n~~b~You will be release soon.", 10000, 4);
SetTimer("HospitalRelease", 10000, false);
PlayerInfo[playerid][pHospitalized] = 1;
SavePlayerProfile(playerid);
return 1;
}

forward HospitalRelease(playerid);
public HospitalRelease(playerid)
{
PlayerInfo[playerid][pHospitalCured] = 1;
PlayerInfo[playerid][pHospitalized] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 50);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~r~Released and Healed", 5000, 4);
OnPlayerSpawn(playerid);
SendClientMessage(playerid, COLOR_WHITE, "{FFDD00}Las Venturas Hospital{FFFFFF}: You have been cured and released.");
return 1;
}
THIS MIGHT!!!WORK!!!
Not Tested.
Also You confuse yourself here might as well define the coords like
pawn Код:
#define hospitalspawn coords
I Don't this this will work but you can try it...

EDITED: Found a mistake after posted it U_U
Reply


Messages In This Thread
help me fix onplayerdeath - by sotau - 03.10.2012, 02:31
Re: help me fix onplayerdeath - by SwisherSweet - 03.10.2012, 02:33
Re: help me fix onplayerdeath - by SwisherSweet - 03.10.2012, 02:36
Re: help me fix onplayerdeath - by sotau - 03.10.2012, 03:59
Re: help me fix onplayerdeath - by C00K13M0N$73R - 03.10.2012, 06:10
Re: help me fix onplayerdeath - by sotau - 03.10.2012, 13:28
Re: help me fix onplayerdeath - by xMCx - 03.10.2012, 13:47
Re: help me fix onplayerdeath - by sotau - 04.10.2012, 01:15
Re: help me fix onplayerdeath - by SwisherSweet - 04.10.2012, 02:48

Forum Jump:


Users browsing this thread: 4 Guest(s)