OnPLayerDeath fs
#1

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.
Reply
#2

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.
Reply
#3

Obrigado FreeGells
Reply
#4

De nada
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)