Random missions - 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: Random missions (
/showthread.php?tid=593892)
Random missions -
Hessu - 11.11.2015
Hi
I am going to update the missions system on my server again, hoping to create a mission builder.
A mission builder itself is wery simple, but i want it to show only missions from the nearby (a distance from Fallen tree to montgomery etc etc).
I think the best bet is to use GetPlayerDistanceFromPoint and use something like this:
pawn Код:
if(GetPlayerDistanceFromPoint(playerid, 237.9, 115.6, 1010.2) <= 1000.0)
{
}
What do you think? Is there something i should/could do to make this easier or something?
Second thing is, how to save the mission id's for further randoming (since i random the missions from the nearby and select 3 of them using random)?
Thanks for advices in advance!
Re : Random missions -
Dutheil - 11.11.2015
I think you don't mention enough codes to help you.
Re: Random missions -
PrO.GameR - 11.11.2015
Use streamer's dynamic areas >
IsPlayerInDynamicArea(playerid, areaid, recheck = 0)
You can simply count them, then random on their count number and choose those 3 that you randomed their numbers.
Re: Random missions -
Hessu - 11.11.2015
Here is the enumelator for the loads
pawn Код:
// Setup a custom type that holds all data about a load
enum TLoad
{
LoadName[50], // The name of the load
bool:Smuggler, // Holds "true" if this load is wanted by the Smuggler
Float:PayPerUnit, // Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
PCV_Required, // This holds the vehicle-type the player needs to use this load (and automatically the player's class)
FromLocations[30], // This array holds all loading-points for this load
ToLocations[30] // This array holds all unloading-points for this load
}
Should i add a line to it called "areas" and assign a name/id for each load and then use dynamic area check?