[HELP] Engine system
#1

First of all, thank's for looking that topic.

Now the point is that, /engine dont work on dealership cars, if i rentcar or use some other car it works perfect.

Quote:

if(strcmp(cmd, "/engine", true) == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
if(IsPlayerConnected(playerid))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY," You are not even inside a vehicle !");
return 1;
}
if(IsNotAEngineCar(idcar))
{
SendClientMessage(playerid,COLOR_GREY," This vehicle dosent even have a Engine !");
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(idcar >= 1 && idcar <= 9)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pCarkey] == VehicleOwned[idcar]) { }
else if(PlayerInfo[playerid][pCarkey2] == VehicleOwned[idcar]) { }
else if(PlayerInfo[playerid][pCarkey3] == VehicleOwned[idcar]) { }
else { return 1; }
}
if(ReduceTime[playerid] > 0)
{
format(string, sizeof(string), " You need to wait %d seconds to type this command.", ReduceTime[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", RandMask[playerid]); }
if (VehicleEngine[idcar] == 0)
{
format(string, sizeof(string), "* %s spins the %s's key into the ignition and turns on the engine.", sendername, VehicleName[GetVehicleModel(idcar)-400]);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
new RandomStart;
RandomStart = random(4);
switch(RandomStart)
{
case 0,1,2:
{
if(VehAsk[playerid] == 1)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
VehAsk[playerid] = 0;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,al arm,doors,bonnet,boot,objective);
}
VehicleEngine[idcar] = 1;
format(string, sizeof(string), "* %s engine starts (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
case 3:
{
format(string, sizeof(string), "* %s engine does not start (( %s ))", VehicleName[GetVehicleModel(idcar)-400], sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
ReduceTime[playerid] = 3;
}
}
}
else if (VehicleEngine[idcar] == 1)
{
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
VehicleEngine[idcar] = 0;
format(string, sizeof(string), "* %s spins the %s's key into the ignition and turns the engine off.", sendername, VehicleName[GetVehicleModel(idcar)-400]);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,b onnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,a larm,doors,bonnet,boot,objective);
VehAsk[playerid] = 1;
}
}
return 1;
}

Again, thanks for watching.
Reply
#2

Pump, will some1 help me?
Reply
#3

1) It's BUMP not PUMP
2) Don't bump unless it's been 48hrs
3) Nice to meet you, im the asshole Steven
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)