02.12.2011, 09:32
Hey,
I have engine code but all of the cars can do the command that engine the car.I want to do that some cars doesn't can to engine it.
The command:
The script:
I have engine code but all of the cars can do the command that engine the car.I want to do that some cars doesn't can to engine it.
The command:
pawn Код:
if(strcmp(cmd, "/on", true) == 0 || strcmp(cmd, "/engine", true) == 0)
{
ShowVehicleControlDialog(playerid);
return 1;
}
pawn Код:
if(dialogid == VEHICLE_CONTROL_DIALOG+1)
{
if(response)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(Gas[idcar] == 0)
return SendClientMessage(playerid,COLOR_GREY," No fuel in this vehicle! Call a Mechanic (555)!");
if(dying[playerid] == 1)
return SendClientMessage(playerid,COLOR_GREY," Do not Bug Abuse!");
SendClientMessage(playerid, COLOUR_INFORMATION, "You have started your engine.");
TogglePlayerControllable(playerid, 1);
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), ON, lights, alarm, doors, bonnet, boot, objective);
}
}
if(!response)
{
SendClientMessage(playerid, COLOUR_INFORMATION, "You have stopped your engine.");
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), OFF, lights, alarm, doors, bonnet, boot, objective);
}
#if defined AUTO_REOPEN_DIALOG
ShowVehicleControlDialog(playerid);
#endif
return 1;
}