SA-MP Forums Archive
OnPLayerDeath fs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: OnPLayerDeath fs (/showthread.php?tid=283651)



OnPLayerDeath fs - rafa3dify - 16.09.2011

Boa noite galera, sabe quando alguem morre em los santos, ele й setado para o hospital de los santos. Quando morre em las aventura, ele vai para o hospital de las aventura? Entao.. Como que faзo para quando ele morrer, for setado para o hospital mais proximo? Abraзos, Rafael.


Re: OnPLayerDeath fs - FreeGells - 16.09.2011

Olб rafael.
Tente desta seguinte forma:
pawn Код:
// Inicio do GameMode
new Local[MAX_PLAYERS];
// OnPlayerDeath
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsPlayerInPlace(playerid, -1377.989, -2989.536, 1599.869, -1004.297))
    {
        Local[playerid] = 1;
    }
    else if(IsPlayerInPlace(playerid, 2942.825, 794.0955, 2884.435, 618.9274))
    {
        Local[playerid] = 2;
    }
    else if(IsPlayerInPlace(playerid, 2884.435, 175.1681, -887.5186, -2744.301))
    {
        Local[playerid] = 3;
    }
    return 1;
}
// OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
    if(Local[playerid] == 1)
    {
        // Seta a Pos Para SF.
    }
    else if(Local[playerid] == 2)
    {
        // Seta a Pos para LV.
    }
    else if(Local[playerid] == 3)
    {
        // Seta a Pos Para LS.
    }
    return 1;
}
// Fim Do GameMode:
stock IsPlayerInPlace(playerid, Float:XMin, Float:YMin, Float:XMax, Float:YMax )
{
    new retur = 0;
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X >= XMin && Y >= YMin && X < XMax && Y < YMax)
    {
        retur = 1;
    }
    return retur;
}
Espero ter ajudado.


Re: OnPLayerDeath fs - rafa3dify - 16.09.2011

Obrigado FreeGells


Re: OnPLayerDeath fs - FreeGells - 16.09.2011

De nada