22.08.2015, 01:34
you can do that using random, try this
Код:
CMD:overload(playerid, params[]) { SendMessageToAdmins(playerid, "overload", params); if (GetPlayerTeam(playerid) == 1) { new m = GetVehicleModel(GetPlayerVehicleID(playerid)); if(m == 514 || m == 515 || m == 403 || m == 455) { new t = GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))); if (t == 435 || t == 450 || t == 584 || m == 455) { if (GetPlayerVehicleSeat(playerid) == 0) { new Message[180], rand = random(5); if (random > 1) { format(Message, sizeof(Message), "Your truck is over loaded!"); SendClientMessage(playerid, WORK, Message); TruckLoad[playerid] = 1; } else { SendClientMessage(playerid, WORK, "Truck was not overloaded."); } } else { SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not the driver of this vehicle"); } } else { SendClientMessage(playerid, COLOR_LIGHTGREEN, "You do not have a trailer, please go and attach one!"); } } else { SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are not in a truck, please go and get one!"); } } return 1; }