[Pedido] base de um /procurar
#3

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;
}
Crйditos: DrTHE
Tуpico: https://sampforum.blast.hk/showthread.php?tid=375945
Reply


Messages In This Thread
base de um /procurar - by Gutierrez_zikaloko - 16.04.2013, 19:13
Re: base de um /procurar - by StringBR - 16.04.2013, 20:12
Re: base de um /procurar - by smiiir - 16.04.2013, 20:17
Re: base de um /procurar - by Gutierrez_zikaloko - 17.04.2013, 18:51

Forum Jump:


Users browsing this thread: 1 Guest(s)