/portamalas e /capo
#1

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.
Reply
#2

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
Reply
#3

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.
Reply
#4

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.
Reply
#5

consegui obg.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)