Vehicle Engine system
#1

Hello guys, i'm having a few problems finding a way to make /e works for faction cars

PHP код:
CMD:e(playeridparams[])
{
           new 
vehicleid GetPlayerVehicleID(playerid);
           new 
lightsalarmdoorsbonnetbootobjective,string[256];
           if(
vehicleid != INVALID_VEHICLE_ID)
           if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridGREY"You must be in a vehicle before you can do this!");
           if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playeridGREY"Only the driver can do this!");
           if(
PlayerInfo[playerid][OwnedCarID] == vehicleid)
           {
                 if(
Cars[vehicleid][CarEngine] == 0)
                 {
                  
                     
format(stringsizeof(string), "* %s has started the vehicles engine."RemoveUnderLine(name));
                     
NearByMessage(playeridPURPLEstring);
                     
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                     
Cars[vehicleid][CarEngine] = 1;
                 }
                 else if(
Cars[vehicleid][CarEngine] == 1)
                 {
                    
                      
format(stringsizeof(string), "* %s has stopped the vehicles engine."RemoveUnderLine(name));
                      
NearByMessage(playeridPURPLEstring);
                      
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                      
Cars[vehicleid][CarEngine] = 0;
                  }
           }
           if(
PlayerInfo[playerid][OwnedCarID] != vehicleid)
           {
                   
SendClientMessage(playeridGREY"You don't have keys for this vehicle.");
           }
           return 
1;

Here is the enum of the cars

PHP код:
enum Vehicles
{
    
CarModel,
    
CarColour1,
    
CarColour2,
    
CarNos,
    
CarGroup,
    
CarEngine,
    
CarLock,
    
FloatCarPosX,
    
FloatCarPosY,
    
FloatCarPosZ,
    
FloatCarZAngle,
    
GameID,
};
new 
Cars[MAX_VEHICLES][Vehicles]; 
Can you guys suggest a way to edit the /e command and make it able to /e if PlayerInfo[playerid][Faction] = Cars[vehicleid][CarGroup]??
Reply


Messages In This Thread
Vehicle Engine system - by Xenforox - 12.01.2015, 13:10
Re: Vehicle Engine system - by rickisme - 12.01.2015, 13:17
Re: Vehicle Engine system - by Xenforox - 12.01.2015, 13:20
Re: Vehicle Engine system - by rickisme - 12.01.2015, 13:35
Re: Vehicle Engine system - by Xenforox - 12.01.2015, 18:30
Re: Vehicle Engine system - by Xenforox - 12.01.2015, 20:01
Re: Vehicle Engine system - by Raisingz - 12.01.2015, 20:52
Re: Vehicle Engine system - by Xenforox - 12.01.2015, 22:09
Re: Vehicle Engine system - by Xenforox - 13.01.2015, 19:53
Re: Vehicle Engine system - by Ciarannn - 13.01.2015, 22:08

Forum Jump:


Users browsing this thread: 1 Guest(s)