Trucking missions (+rep for working fix) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Trucking missions (+rep for working fix) (
/showthread.php?tid=588171)
Trucking missions (+rep for working fix) -
Hessu - 06.09.2015
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.
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++;
}
}
}
}
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).
Re: Trucking missions (+rep for working fix) -
Tamy - 06.09.2015
Код:
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)
{
for(new nn=NumProducts; nn<(NumProducts+10); nn++)
{
// Add the ProductID to the ProductList
ProductList[NumProducts] = GetRealRandom(nn); //Add the LoadID to the slot (0-50)
}
}
}
}
}
Re: Trucking missions (+rep for working fix) -
Hessu - 06.09.2015
delete
AW: Trucking missions (+rep for working fix) -
Skimmer - 06.09.2015
pawn Код:
for (new i; i < sizeof(ALoadsLS); i++)
to
pawn Код:
for (new i = 0; i < sizeof(ALoadsLS); i++)
Re: AW: Trucking missions (+rep for working fix) -
xVIP3Rx - 06.09.2015
Quote:
Originally Posted by Skimmer
pawn Код:
for (new i; i < sizeof(ALoadsLS); i++)
to
pawn Код:
for (new i = 0; i < sizeof(ALoadsLS); i++)
|
Why ? isn't it the same ?, new blabla; will be 0;
Re: Trucking missions (+rep for working fix) -
Hessu - 06.09.2015
delete
Re: Trucking missions (+rep for working fix) -
Hessu - 06.09.2015
delete