03.09.2015, 15:45
Hello so i got this hotwire command and i want it to be 50% chance of it starting so if i do /hotwire it would say something underdashboard and that and if it fails it will say "PlayerA tweaks with the vehicle wires and gets shocked" something like that but if the player gets it then the car will start and this is only for unowned cars or if a player leaves his car unlocked and if it starts it will say "PlayerA tweaks with the vehicle wires((Engine starts))"
Код:
command(hotwire, playerid, params[]) { new string[128]; new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid,realvehicleid; vehicleid = GetVehicleFileIDEx(playerid, GetPlayerVehicleID(playerid)); realvehicleid = GetPlayerVehicleID(playerid); GetVehicleParamsEx(realvehicleid,engine,lights,alarm,doors,bonnet,boot,objective); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, WHITE, "You are not in a vehicle!"); if(engine == VEHICLE_PARAMS_ON) { return SendClientMessage(playerid, WHITE, "You cannot hotwire a vehicle that is already on."); } else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)) { format(string, sizeof(string), "** %s tweaks with the vehicle's wires under the dashboard.", GetName(playerid)); NearByMessage(playerid, SCRIPTPURPLE, string); SetTimerEx("SetVehicleEngine", 1700, 0, "dd", vehicleid, playerid); CarHotwireStatus{vehicleid} = 1; } return 1; }