06.09.2015, 08:23
I have been doing trucking missions that works that way when you are in axample san fierro, it shows you missions for that area, randomally, 3 missions to select from from the dialog.
Here is a piece of this code and as you can see, i have definied the ammount of missions from "ALoadsLS" to be randomized. I dont want to do this and make the script to definie itself.
See at line : new nn = NumProducts + 10;
Here i have definied that there is 10 missions made in ALoadsLS, but i want to loop this so i dont need to definie it.
Ask if you didnt understand and +rep for working code.
Also if someone is willing to make loads for the trucking server, pm me. Easy code, but needs locistic and time. Will be revarded with level 4 admin (out of 5).
Here is a piece of this code and as you can see, i have definied the ammount of missions from "ALoadsLS" to be randomized. I dont want to do this and make the script to definie itself.
pawn Код:
else if(PlayerIsInLS == true)
{
// Loop through all products
for (new i; i < sizeof(ALoadsLS); i++)
{
if (NumProducts < 3) // Not all PCV's, just how meny is added to the list (showd to player in dialog)
{
// Check if the current product has the same PCV_Needed
if (ALoadsLS[i][PCV_Required] == PCV_Needed)
{
new nn = NumProducts + 10;
// Add the ProductID to the ProductList
ProductList[NumProducts] = GetRealRandom(nn); //Add the LoadID to the slot (0-50)
// Increase the counter NumProducts
NumProducts++;
}
}
}
}
Here i have definied that there is 10 missions made in ALoadsLS, but i want to loop this so i dont need to definie it.
Ask if you didnt understand and +rep for working code.
Also if someone is willing to make loads for the trucking server, pm me. Easy code, but needs locistic and time. Will be revarded with level 4 admin (out of 5).