Help to adapt a system
#1

Actually i have a pocket system adapted to my gm, but the system isn't corrlation to the pocket system, that, must be a system similar to the system of LSRP.com or .es, I try to adapt this but say "You not close to the vehicle" when I'm next to the vehicle

I don't know if it a wrong adaptation or a function of the coords are wrong. My GM it's adaptation of Zc

This is the command

PHP код:
CMD:maletero(playeridparams[])
{
     if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridRojo"* No puedes abrir el maletero desde dentro de un vehнculo.");
    if(
Info[playerid][pVehicleKeysFrom] != INVALID_PLAYER_ID)
    
    if(
strcmp(params,"abrir",true) == 0//Abrir maletero
    
{
        new 
car,Float:fVehPos[3], Float:vXFloat:vYFloat:vZ,Float:distancia 4.0;
        for(new 
MAX_PLAYERVEHICLESd++)
        {
            
GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], fVehPos[0], fVehPos[1], fVehPos[2]);
            if(
IsPlayerInRangeOfPoint(playerid4.0fVehPos[0], fVehPos[1], fVehPos[2]) && !IsABike(d) && VehMaletero[d] == 1)
            {
                if(
GetPlayerDistanceFromPoint(playeridvXvYvZ) <= distancia)distancia GetPlayerDistanceFromPoint(playeridvXvYvZ), car d;
            }
        }
        new 
string[120];
        if(
car == 0){SendClientMessage(playeridCOLOR_WHITE"* No se ha detectado ningъn vehнculo a tu alrededor que puedas abrir."); return 1;}
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
        
SetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,1,objective);
        
format(stringsizeof(string), "* %s abre el maletero de un vehнculo."GetPlayerNameEx(playerid));
         
ProxDetector(15.0playeridstring,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         
VehMaletero[car] = 1;
         
MostrarMaletero(playeridcar);
        
VehMaleteroPlayer[playerid] = car;
         return 
1;
    }
    else if(
strcmp(params,"ver",true) == 0//Mostrar maletero
    
{
        new 
car,Float:fVehPos[3], Float:vXFloat:vYFloat:vZ,Float:distancia 4.0;
        for(new 
MAX_PLAYERVEHICLESd++)
        {
            
GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], fVehPos[0], fVehPos[1], fVehPos[2]);
            if(
IsPlayerInRangeOfPoint(playerid4.0fVehPos[0], fVehPos[1], fVehPos[2]) && !IsABike(d) && VehMaletero[d] == 1)
            {
                if(
GetPlayerDistanceFromPoint(playeridvXvYvZ) <= distancia)distancia GetPlayerDistanceFromPoint(playeridvXvYvZ), car d;
            }
        }
        if(
car == 0){SendClientMessage(playeridCOLOR_WHITE"No se ha detectado ningъn vehнculo a tu alrededor con el maletero abierto."); return 1;}
        
MostrarMaletero(playeridcar);
        
VehMaleteroPlayer[playerid] = car;
        return 
1;
    }
    else if(
strcmp(params,"cerrar",true) == 0//Cerrar maletero
    
{
          new 
car,Float:fVehPos[3], Float:vXFloat:vYFloat:vZ,Float:distancia 4.0;
        for(new 
MAX_PLAYERVEHICLESd++)
        {
            
GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], fVehPos[0], fVehPos[1], fVehPos[2]);
            if(
IsPlayerInRangeOfPoint(playerid4.0fVehPos[0], fVehPos[1], fVehPos[2]) && !IsABike(d) && VehMaletero[d] == 1)
            {
                if(
GetPlayerDistanceFromPoint(playeridvXvYvZ) <= distancia)distancia GetPlayerDistanceFromPoint(playeridvXvYvZ), car d;
            }
        }
        new 
string[120];
        if(
car == 0){SendClientMessage(playeridCOLOR_WHITE"No se ha detectado ningъn vehнculo a tu alrededor con el maletero abierto."); return 1;}
        new 
engine,lights,alarm,doors,bonnet,boot,objective;
        
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
        
SetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,0,objective);
        
format(stringsizeof(string), "* %s cierra el maletero de un vehнculo."GetPlayerNameEx(playerid));
         
ProxDetector(15.0playeridstring,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         
VehMaletero[car] = 0;
         return 
1;
    }
    else{
SendClientMessage(playeridCOLOR_WHITE"/maletero [Abrir/Ver/Cerrar]");
    return 
1;
    }

Thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)