02.05.2014, 05:22
This
Engine params, doesnt work
how to fix it?
Engine params, doesnt work
pawn Code:
else if(strcmp(params, "engine", true) == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
/*if (vdisabled[GetPlayerVehicleID(playerid)])
{
SendClientMessage(playerid, COLOR_RED, "The car's engine is too damaged to start!- Call a mechanic! /service mechanic");
return 1;
}*/
new vehicle = GetPlayerVehicleID(playerid);
new string[126];
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(Engine[vehicle] == 0)
{
if(VehicleBomb[vehicle] == 1)
{
new Float:boomx, Float:boomy, Float:boomz;
GetVehiclePos(vehicle, boomx, boomy, boomz);
CreateExplosion(boomx, boomy , boomz, 7, 1);
if(pMask[playerid] == 1)
{
format(string, sizeof(string), "* Stranger failed to start the engine and car bomb exploded");
}
else
{
format(string, sizeof(string), "* %s failed to start the engine and car bomb exploded", GetPlayerNameEx(playerid));
}
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, COLOR_YELLOW, "The vehicle exploded because of the car bomb planted by an hitman!");
return engine;
}
else
{
Engine[vehicle] = 1;
SetVehicleParamsEx(vehicle,1,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s turns the engine of their vehicle engine on.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, -1, "Vehicle engine started successfully! Type (/car engine) to stop it");
return 1;
}
}
else
{
Engine[vehicle] = 0;
SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "* %s turns the vehicles engine off.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessage(playerid, -1, "Vehicle engine stopped. Type (/car engine) to start");
return 1;
}
}
return engine;
}
return 1;
}



