SA-MP Forums Archive
Problem on OnPlayerDeath - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem on OnPlayerDeath (/showthread.php?tid=523105)



Problem on OnPlayerDeath - Vindicated - 30.06.2014

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;




Re: Problem on OnPlayerDeath - GeekSiMo - 30.06.2014

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


Re: Problem on OnPlayerDeath - Vindicated - 30.06.2014

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?