[Pedido] /localizar
#5

pawn Код:
#include <a_samp>
#include <a_zones>
#include <zcmd>

new Timer[MAX_PLAYERS];
forward Localizador(playerid, otherid);

public Localizador(playerid, otherid)
{
    if(!IsPlayerConnected(otherid)) return KillTimer(Timer[playerid]);
    new Float:x, Float:y, Float:z, Float:o_Distance, a[128], zone[MAX_ZONE_NAME];
    GetPlayerPos(otherid, x, y, z);
    o_Distance = GetPlayerDistanceFromPoint(playerid, x, y, z),
    format(a, sizeof(a), "%s~n~Distвncia: %0.2f metros~n~Local: %s", PlayerName(otherid), o_Distance, GetPlayer2DZone(otherid, zone, MAX_ZONE_NAME));
    GameTextForPlayer(playerid, a, 3000, 5);
    return 1;
}

CMD:procurar(playerid, params[])
{
    if(isnull(params)) return false;
    new otherid = strval(params);
    if(!IsPlayerConnected(otherid)) return false;
    Timer[playerid] = SetTimerEx("Localizador", 1500, true, "dd", playerid, otherid);
    return 1;
}

CMD:parar(playerid, params[])
{
    #pragma unused params
    KillTimer(Timer[playerid]);
    return 1;
}

stock PlayerName(playerid)
{
    new a[MAX_PLAYER_NAME];
    GetPlayerName(playerid, a, MAX_PLAYER_NAME);
    return a;
}
Reply


Messages In This Thread
/localizar - by Nayara._. - 08.09.2012, 16:40
Re: /localizar - by DrTHE - 08.09.2012, 16:51
Re: /localizar - by Abravanel - 08.09.2012, 16:54
Re: /localizar - by FeelLikeASir_ - 08.09.2012, 17:09
Re: /localizar - by DrTHE - 08.09.2012, 17:14
Re: /localizar - by Nayara._. - 10.09.2012, 00:56
Re: /localizar - by Nayara._. - 10.09.2012, 01:32
Re: /localizar - by MarcosRodrigo - 01.05.2013, 16:05
Re: /localizar - by mau.tito - 01.05.2013, 16:24

Forum Jump:


Users browsing this thread: 1 Guest(s)