07.12.2012, 22:07
how can i make a thingy so i cant start engine at a cOwned car 0.because i type /exit and engine starts..
PHP код:
if(strcmp(cmd, "/engine", true) == 0)
{
if(GetPlayerState(playerid)== PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid,engine,lights, alarm, doors,boot, bonnet, objective);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_GREY,"Nu esti la volan.");
if(engineOn[playerid] == 0)
{
engineOn[playerid] = 1;
SetVehicleParamsEx(vehicleid,1,lights, alarm, doors,boot, bonnet, objective);
if(IsARentCar(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsABarca(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAMotor(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAnOwnableCar(idcar) && CarInfo[idcar][cOwned] == 0)
{
if(IsPlayerAdmin(playerid)) { }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 0);
return 1;
}
}
if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");
SendClientMessage(playerid, COLOR_PURPLE, "{FFFFFF}Ai pornit motorul vehiculului {278227}engine on!");
TogglePlayerControllable(playerid, 1);
return 1;
}
else // ELSE////////////////////////////////////////////////////////////////////////
{
engineOn[playerid] = 0;
SetVehicleParamsEx(vehicleid,0,lights, alarm, doors,boot, bonnet, objective);
if(IsARentCar(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsABarca(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAMotor(idcar))
{
if(HireCar[playerid] != idcar) return 1;
}
if(IsAnOwnableCar(idcar) && CarInfo[idcar][cOwned] == 0)
{
if(IsPlayerAdmin(playerid)) { }
else
{
CanTurnEngine[playerid] = 9999;
TogglePlayerControllable(playerid, 0);
}
}
if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
return SendClientMessage(playerid, COLOR_GREY,"* You cannot turn this car's engine!");
SendClientMessage(playerid, COLOR_PURPLE, "{FFFFFF}Ai oprit motorul vehiculului {E60000}engine off!");
TogglePlayerControllable(playerid, 0);
return 1;
}
}
return 1;
}