SA-MP Forums Archive
[Ajuda] No Capo - 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: [Ajuda] No Capo (/showthread.php?tid=664939)



No Capo - Syxh0wN - 16.03.2019

pawn Code:
if(strcmp(tmp,"neon",true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
            return SendClientMessage(playerid,COLOR_LIGHTRED,"USE:{C5C3C1} Você precisa estar fora do veiculo.");

        for(new i = 0; i < MAX_VEHICLES; i ++)
        {
            if (!IsPlayerNearHood(playerid, i)) return SendClientMessage(playerid,COLOR_LIGHTRED, "{FF4F4F}ERRO:{FFFFFF} Você não está próximo a nenhum capo!");
            //INSTALAR NEON
        }
    }


    stock IsPlayerNearHood(playerid, vehicleid)
{
    static
        Float:fX,
        Float:fY,
        Float:fZ;

    GetVehicleHood(vehicleid, fX, fY, fZ);
    return (GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(vehicleid)) && IsPlayerInRangeOfPoint(playerid, 3.0, fX, fY, fZ);
}
Alguem ajuda? está dando que o o jogador não está na frente do capo do veículo


Re: No Capo - ipsLuan - 16.03.2019

Como está GetVehicleHood?


Re: No Capo - Syxh0wN - 16.03.2019

Quote:
Originally Posted by ipsLuan
View Post
Como estб GetVehicleHood?
Uso a inclube EVF man


Re: No Capo - humildadeforever - 16.03.2019

Quote:
Originally Posted by Syxh0wN
View Post
Uso a inclube EVF man
Jб tentou algo como:

PHP Code:
    if(strcmp(tmp,"neon",true) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid))
            return 
SendClientMessage(playerid,COLOR_LIGHTRED,"USE:{C5C3C1} Vocк precisa estar fora do veiculo.");
        new 
contar 0;
        for(new 
0MAX_VEHICLES++) 
        {
            if (
IsPlayerNearHood(playeridi))
            {
                 
contar ++;
                 
//codigo de instalar neon
                 
break;
            }
        }
        if(
contar == 0) return SendClientMessage(playerid,COLOR_LIGHTRED"{FF4F4F}ERRO:{FFFFFF} Vocк nгo estб prуximo a nenhum capo!");
        return 
1;
    } 
?