29.05.2014, 06:23
Try This -
pawn Код:
forward WireIgnition(playerid, vehicleid);
public WireIgnition(playerid, vehicleid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new rand = random(7), string[128];
PlayerInfo[playerid][pJackingCar] =0;
if(IsPlayerInVehicle(playerid, vehicleid))
{
if(rand == 1 || rand == 2) // Successful
{
format(string, sizeof(string), "* %s successfully wires the ignition, turning the engine on.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
SetTimerEx("DisableVehicleAlarm", 30000, 0, "d", vehicleid);
SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
SetTimerEx("SetVehicleEngine", 1000, 0, "dd", vehicleid, playerid);
}
else
{
format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
SetTimerEx("DisableVehicleAlarm", 30000, 0, "d", vehicleid);
}
}
else
{
format(string, sizeof(string), "* %s fails to wire the ignition.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
SetTimerEx("DisableVehicleAlarm", 30000, 0, "d", vehicleid);
}
}