Problem on OnPlayerDeath
#1

Hello, Im opening a RP Server, but when someone dies, Its teleport him to Blueberrys (Coordinate 000) instead to the hospotal (-676.3841, -726.8386, 1072.5399)
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
TextDrawShowForPlayer(playeridTextdraw0);
    
TextDrawShowForPlayer(playeridTextdraw1);
    
SendClientMessage(killeridCOLOR_TWRED"They black out, and fall to the ground...");
    
SendClientMessage(playeridCOLOR_TWRED"You black out, and fall to the ground...");
    
ClearWeapons(playerid);
    
TogglePlayerSpectating(playeridtrue);
    
TogglePlayerControllable(playeridfalse);
    
SetTimerEx("Hospital"250000"i"playerid);
    return 
1;
}
public 
Hospital(playerid)
{
    new 
string[256];
    
TogglePlayerSpectating(playeridfalse);
    
SetSpawnInfo(playerid0PlayerInfo[playerid][pSkin], -318.65221049.390920.3403358.4333000000);
    
SpawnPlayer(playerid);
    
SetPlayerInterior(playerid5);
    
SetPlayerPos(playerid, -676.3841, -726.83861072.5399);
    
SetPlayerFacingAngle(playerid91.4410);
    
TogglePlayerControllable(playeridtrue);
    
SendClientMessage(playeridCOLOR_TWPINK"You wake up in a hospital bed, a bit dizzy, and cannot remember what had happened!");
    
TextDrawHideForPlayer(playeridTextdraw0);
    
TextDrawHideForPlayer(playeridTextdraw1);
    
format(stringsizeof(string), " %s slowly opens his eyes, waking up in a hospital bed"GetPlayerNameEx(playerid));
    
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 
1;

Reply
#2

Use boolead(playerid)
OnPlayerDeath : Dead(playerid) = true
OnPlayerSpawn : if(Dead(playerid) == true), Hospital(playerid)
Reply
#3

Quote:
Originally Posted by GeekSiMo
Посмотреть сообщение
Use boolead(playerid)
OnPlayerDeath : Dead(playerid) = true
OnPlayerSpawn : if(Dead(playerid) == true), Hospital(playerid)
Sorry for being stupid, but where should i put it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)