SA-MP Forums Archive
Little help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Little help (/showthread.php?tid=228596)



Little help - Anzhelov - 20.02.2011

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerPos(playerid,-1514.7246,2524.8870,55.7863);
    SetPlayerFacingAngle(playerid, 0.5606);
    GivePlayerMoney(playerid,-200);
    SendClientMessage(playerid,COLOR_RED,"You payed 200 $ for your medical bill. You were");
    SendClientMessage(playerid,COLOR_RED,"found nearly dead. You are lucky you're even alive.");
    SendClientMessage(playerid,COLOR_RED,"Thank you, and have a nice day.");
    return 1;
}
I want when someone die to spawn at El Querbrados hospital, but there is problem ...
When you die, you spawn at the hospital and there you fall on the ground and die again and spawn at the AddPlayerClass possition. How to fix it?


Re: Little help - Marricio - 20.02.2011

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerPos(playerid,-1514.7246,2524.8870,55.7863);
    SetPlayerFacingAngle(playerid, 0.5606);
    GivePlayerMoney(playerid,-200);
    SendClientMessage(playerid,COLOR_RED,"You payed 200 $ for your medical bill. You were");
    SendClientMessage(playerid,COLOR_RED,"found nearly dead. You are lucky you're even alive.");
    SendClientMessage(playerid,COLOR_RED,"Thank you, and have a nice day.");
    TogglePlayerControllable(playerid,0);
    SetTimerEx("Freeze",2000,true,"i",playerid);
    return 1;
}
forward Freeze(playerid);
public Freeze(playerid)
{
    TogglePlayerControllable(playerid,1);
}



Re: Little help - Anzhelov - 20.02.2011

Same


Re: Little help - AlExAlExAlEx - 20.02.2011

Get the coords again.


Re: Little help - Stigg - 20.02.2011

If your using an interior to spawn into, dont forget to set player interior.

Peace...


Re: Little help - Serbish - 20.02.2011

Код:
// @ Top of the script:

new Respawn[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Respawn[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(Respawn[playerid] == 1)
    {
        SetPlayerPos(playerid,-1514.7246,2524.8870,55.7863);
        SetPlayerFacingAngle(playerid, 0.5606);
        SetPlayerInterior(playerid, 0); // Interior 0 if it's outside.        
        GivePlayerMoney(playerid,-200);
        SendClientMessage(playerid,COLOR_RED,"You payed 200 $ for your medical bill. You were");
        SendClientMessage(playerid,COLOR_RED,"found nearly dead. You are lucky you're even alive.");
        SendClientMessage(playerid,COLOR_RED,"Thank you, and have a nice day.");
    }    
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    Respawn[playerid] = 1;
    return 1;
}