if(!strcmp(cmd, "/engine", true))
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " You must be in a vehicle");
return 1;
}
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey4] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
if(IsAGarbage(idcar))
{
return 1;
}
new vehicle = GetPlayerVehicleID(playerid);
if(Motor[vehicle] == 1) { return 1; }
new motor, lights, alarm, doors, bonnet, boot, objective;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s invarte cheia si incearca sa porneasca motorul.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",500,0,"i",playerid );
GameTextForPlayer(playerid, "~w~Pornind Motor...",500,3);
Motor[vehicle] = 1;
GetVehicleParamsEx(vehicle, motor, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
return 1;
}
if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey4] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsADrugHarvest(idcar))
{
return 1;
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
new vehicle = GetPlayerVehicleID(playerid);
engineOn[GetPlayerVehicleID(playerid)] = false;
//RemovePlayerFromVehicle(playerid);
new motor, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, motor, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Opreste motorul.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
Motor[vehicle] = 0;
return 1;
}
}
return 1;
}
and ownable:
public IsAnOwnableCar(vehicleid)
{
if(vehicleid >= 357 && vehicleid <= 550) { return 1; }
return 0;
}