Little help
#1

Код:
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?
Reply
#2

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);
}
Reply
#3

Same
Reply
#4

Get the coords again.
Reply
#5

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

Peace...
Reply
#6

Код:
// @ 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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)