Choosing a vehicle model ID
#1

So I am creating this import system, similar to the Single Player. But I have no idea on how would I generate a random vehicle model ID (avoiding selecting an invalid ID, boat, planes, trains)

This is how I coded the Import System.

PHP код:
// Timer 
if(EIsystem[0][gBonusModel])
{
    if(!
EIsystem[0][gGotBonus])
    {
        
format(stringsizeof(string), "[EASTER BASIN]"white" %dx %s hasn't been imported to %s (There are %d still needed %s to get it shipped to %s)."EIsystem[0][gRequiredBonus], GetVehicleNameEx(EIsystem[0][gBonusModel]), EILocations[EIsystem[0][gAssignedLocation]], EIsystem[0][gRequiredBonus] - EIsystem[0][gDeliveredBonus], GetVehicleNameEx(EIsystem[0][gBonusModel]), EILocations[EIsystem[0][gAssignedLocation]]);
        if(!
closestdepot)
        {
            
SendClientMessage(playeridCOLOR_LIGHTGREENstring);
            
SendClientMessage(playerid"[SHIPMENT NOTICE]"white" A new required vehicle imports will arrive shortly, Please wait until furthermore notice.");
        }
        
        
printf("* The shipment of %s from Easter Basin to %s has been cancelled due to lack of %d more %s."GetVehicleNameEx(EIsystem[0][gBonusModel]), EILocations[EIsystem[0][gAssignedLocation]], EIsystem[0][gRequiredBonus] - EIsystem[0][gDeliveredBonus], GetVehicleNameEx(EIsystem[0][gBonusModel]));
        
EIsystem[0][gAssignedLocation] = -1;
        
EIsystem[0][gRequiredBonus] = 0;
        
EIsystem[0][gBonusModel] = 0;
        
EIsystem[0][gBonusMoney] = 0;
        
EIsystem[0][gDeliveredBonus] = 0;
    }
}
else
{
    if(!
closestdepot)
    {
        
EIsystem[0][gAssignedLocation] = random(sizeof(EIlocations));
        
EIsystem[0][gRequiredBonus] = Random(25);
        
EIsystem[0][gBonusModel] = 0;
        
EIsystem[0][gBonusMoney] = 0;
        
EIsystem[0][gDeliveredBonus] = 0;
    
        
format(stringsizeof(string), "[EASTER BASIN]"white" We need volunteers who will give away their %s, We current need %dx of them. ($%s overall reward pot)"GetVehicleNameEx(EIsystem[0][gBonusModel]), EIsystem[0][gRequiredBonus], AddComma(EIsystem[0][gBonusCash]));
        
SendClientMessage(playeridCOLOR_LIGHTGREENstring);
        
format(stringsizeof(string), "* The vehicles are to be imported to %s."EIsystem[0][gRequiredBonus]));
        
SendClientMessage(playerid, -1string);
    }

gBonusModel is where the vehicle model ID is stored.
Reply


Messages In This Thread
Choosing a vehicle model ID - by JaKe Elite - 18.11.2016, 11:14
Re: Choosing a vehicle model ID - by TonyII - 18.11.2016, 12:33
Re: Choosing a vehicle model ID - by JaKe Elite - 18.11.2016, 12:54
Re: Choosing a vehicle model ID - by GoldenLion - 18.11.2016, 13:28
Re: Choosing a vehicle model ID - by Dayrion - 18.11.2016, 13:52
Re: Choosing a vehicle model ID - by JaKe Elite - 19.11.2016, 03:31
Re: Choosing a vehicle model ID - by JaKe Elite - 19.11.2016, 05:27
Re: Choosing a vehicle model ID - by BroZeus - 19.11.2016, 06:43
Re: Choosing a vehicle model ID - by Vince - 19.11.2016, 08:35
Re: Choosing a vehicle model ID - by GoldenLion - 19.11.2016, 20:00

Forum Jump:


Users browsing this thread: 1 Guest(s)