[Ajuda]Verificar Бrea
#1

Gostaria de saber se tem alguma public ou algo do Tipo,Para Verificar se um carro estб nesta certa бrea,
Sem que alguйm esteja Prуximo ou Dentro do veнculo.Obg
Reply
#2

https://sampwiki.blast.hk/wiki/Areacheck

Da uma olhada.
Reply
#3

й tipo assim mas,eu quero que ele verifique todos os carros q estiverem nesse ponto e pegar as ID'S deles
Reply
#4

Esses dois tуpicos serгo uteis para vocк, achoq.

https://sampwiki.blast.hk/wiki/Areacheck
https://sampwiki.blast.hk/wiki/IsPlayerInVehicle
Reply
#5

Caro j..
pawn Код:
stock IsVehicleInRangeOfPoint(vehicleid, Float:range, Float:x, Float:y, Float:z)
{
    static
        Float:pX, Float:pY, Float:pZ;

    GetVehiclePos(vehicleid, pX, pY, pZ);
    return x - range / 2 < pX > x + range / 2 && y - range / 2 < pY > y + range / 2 && z - range / 2 < pZ > z + range / 2;
}
for(new i = 0; i <= MAX_VEHICLES; ++i){
    if(IsVehicleInRangeOfPoint(i, x , y, z)) {
        format(string, 128, "%i", i);
        SendClientMessage(playerid, -1, string);
    }
}
Espero ter ajudado
Reply
#6

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
Caro j..
pawn Код:
stock IsVehicleInRangeOfPoint(vehicleid, Float:range, Float:x, Float:y, Float:z)
{
    static
        Float:pX, Float:pY, Float:pZ;

    GetVehiclePos(vehicleid, pX, pY, pZ);
    return x - range / 2 < pX > x + range / 2 && y - range / 2 < pY > y + range / 2 && z - range / 2 < pZ > z + range / 2;
}
for(new i = 0; i <= MAX_VEHICLES; ++i){
    if(IsVehicleInRangeOfPoint(i, x , y, z)) {
        format(string, 128, "%i", i);
        SendClientMessage(playerid, -1, string);
    }
}
Espero ter ajudado
Primeiro adicione streamer

pawn Код:
#include <    streamer    >
depois no topo do gm
pawn Код:
#define dPublic%0(%1) \
    forward%0(%1); public%0(%1)


#define Loop(%0,%1) \
    for(new %0 = 0; %0 != %1; %0++)


new
    Area
;
depois em OnGameModeInt:
pawn Код:
public OnGameModeInt()
{
    Area = CreateDynamicRectangle(Float:minx, Float:miny, Float:maxx, Float:maxy);
    Loop(dTHE, MAX_PLAYERS)
    {
             SetTimerEx("Laila", 1000, true, "d", dTHE);
    }
    return 1;
}
Por fim fora de qualquer CallBack
pawn Код:
dpublic Laila(playerid)
{
    if(IsPlayerInDynamicArea(playerid, Area))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            /*Funcoes*/  //Aqui suas funcoes
        }
    }
}
Espero ter ajudado І
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)