How can I randomize this?
#1

Hey guys I was just working on a ups job, and I wanted to know how I can randomize which set of checkpoints the script displays for the player. I didn't know if I could just switch it and then use cases or what. Any help would be nice.

Код:
CMD:getcargo(playerid, params[])
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498)
	{
	    SendClientMessage(playerid, -1, "Drive through the checkpoints in order to do the UPS job.");
	    
	}
}
That is the command so far (I have all of the checkpoints too, I just didn't add them because I want to know how to randomize them).
Reply
#2

Assuming you already linked the checkpoints to each other, use switch.

pawn Код:
switch(random(4))
{
   case 0: SetPlayerCP(etc...
   case 1: SetPlayerCP(etc...
   case 2: SetPlayerCP(etc...
   case 3: SetPlayerCP(etc...
   case 4: SetPlayerCP(etc...
}
You get the point.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)