SA-MP Forums Archive
/portamalas e /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: /portamalas e /capo (/showthread.php?tid=596664)



/portamalas e /capo - FernandoDutra - 20.12.2015

PHP код:
CMD:portamalas(playeridparams[])
{
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    new 
carro GetPlayerVehicleID(playerid);
    if(
carro != INVALID_VEHICLE_ID)
    {
        if(
portamalas[playerid] == 0)
        {
            new 
string[256];
            
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
              
SetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
            
portamalas[playerid] = 1;
            
format(stringsizeof(string), "* %s leva sua mгo atй o porta-malas do veнculo, logo abrindo-o."GetName(playerid));
            
ProxDetector(20.0playeridstring,COLOR_PURPLE);
        }
        else if(
portamalas[playerid] == 1)
        {
            new 
string[256];
            
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
              
SetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
            
portamalas[playerid] = 0;
            
format(stringsizeof(string), "* %s leva sua mгo atй o porta-malas do veнculo, logo fechando-o."GetName(playerid));
            
ProxDetector(20.0playeridstring,COLOR_PURPLE);
        }
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_RED"[Erro]: Vocк nгo estб prуximo a um veнculo.");
    }
    return 
1;
}
CMD:capo(playeridparams[])
{
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    new 
carro GetPlayerVehicleID(playerid);
    if(
carro != INVALID_VEHICLE_ID)
    {
        if(
capo[playerid] == 0)
        {
            new 
string[256];
            
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
              
SetVehicleParamsEx(carro,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
            
capo[playerid] = 1;
            
format(stringsizeof(string), "* %s leva sua mгo atй o capo do veнculo, logo abrindo-o."GetName(playerid));
            
ProxDetector(20.0playeridstring,COLOR_PURPLE);
        }
        else if(
capo[playerid] == 1)
        {
            new 
string[256];
            
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
              
SetVehicleParamsEx(carro,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
            
capo[playerid] = 0;
            
format(stringsizeof(string), "* %s leva sua mгo atй o capo do veнculo, logo fechando-o."GetName(playerid));
            
ProxDetector(20.0playeridstring,COLOR_PURPLE);
        }
        if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_RED"[Erro]: Vocк nгo estб prуximo a um veнculo.");
    }
    return 
1;

Eu gostaria colocar, para que ele pode-se utilizar o comando somente a frente do carro/atrбs do carro.


Re: /portamalas e /capo - rol3Play - 20.12.2015

tente usar essa funзгo

GetVehiclePos(GetPlayerVehicleID(playerid), x,y,z); //para pegar a posiзгo do veiculo
if(IsPlayerInRangeOfPoint(playerid, 4.0, x,y,z))

voce tambem pode esta adicionando valores em x,y,z para setar a posiзгo que voce deseja


Re: /portamalas e /capo - FernandoDutra - 20.12.2015

Quote:
Originally Posted by rol3Play
Посмотреть сообщение
tente usar essa funзгo

GetVehiclePos(GetPlayerVehicleID(playerid), x,y,z); //para pegar a posiзгo do veiculo
if(IsPlayerInRangeOfPoint(playerid, 4.0, x,y,z))

voce tambem pode esta adicionando valores em x,y,z para setar a posiзгo que voce deseja
okay, vou tentar, jaja posto resposta.


Re: /portamalas e /capo - FernandoDutra - 20.12.2015

C:\Users\Fernando Westen\Documents\SAMP\gamemodes\CHRP.pwn(112 : warning: 213: tag mismatch
C:\Users\Fernando Westen\Documents\SAMP\gamemodes\CHRP.pwn(112 : warning: 213: tag mismatch
C:\Users\Fernando Westen\Documents\SAMP\gamemodes\CHRP.pwn(112 : warning: 213: tag mismatch


antes deu um erro que nгo estava definido o "x", ai eu coloquei, new x,y,z;, porйm comeзou a dar estes warning.


Re: /portamalas e /capo - FernandoDutra - 21.12.2015

consegui obg.