24.01.2017, 16:22
At these time I set up this:
What I need is to remove the camera going up and execute the OnPlayerSpawn code in OnPlayerDeath inmediately he deaths.
Tried OnPlayerDeath return 0, TogglePlayerControlable, Give Health and nothing.
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[playerid][pDeath] == 0)
{
PlayerInfo[playerid][pDeath] = 1;
Update(playerid, pDeathu);
}
else if(PlayerInfo[playerid][pDeath] == 1)
{
PlayerInfo[playerid][pDeath] = 2;
Update(playerid, pDeathu);
}
SaveCoords(playerid);
public OnPlayerSpawn(playerid)
{
if (!IsPlayerNPC(playerid))
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pDeath] == 1)
{
SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
DeathLabel[playerid] = CreateDynamic3DTextLabel("{8A0808}This person is injured", 0xFFFFFFFF, 10.0, -0.45, -0.5, 15, playerid, INVALID_VEHICLE_ID, 0, -1, -1);
SendClientMessage(playerid, -1, "If you don't get healed in 8 minutes you will be respawned at hospital.");
SendToHospital[playerid] = SetTimerEx("Hospital", 60000*8, false, "i", playerid);
TogglePlayerControllable(playerid, 1);
AnimDeath[playerid] = SetTimerEx("DeathAnimation", 2500, false, "i", playerid);
}
else if(PlayerInfo[playerid][pDeath] == 2)
{
DeathLabel[playerid] = CreateDynamic3DTextLabel("{8A0808}This person is death", 0xFFFFFFFF, 10.0, -0.45, -0.5, 15, playerid, INVALID_VEHICLE_ID, 0, -1, -1);
Hospital(playerid);
}
else
{
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
}
Tried OnPlayerDeath return 0, TogglePlayerControlable, Give Health and nothing.

