Quick [Random] Question
#1

So I am making an Arms Dealer command where you do /getmats and it gives you a random place to deliver the materials.

I have a float for the co-ordinates:

Код:
new Float:DROPMATS[][3] =
{
        {-1322.2762,2498.0610,87.0469}, //dropmats one
        {-2433.6064,2293.0537,4.9844}, //dropmats two
        {1405.9614,969.5345,10.8130}, //dropmats three
        {2867.3218,2569.6433,10.8203}, //dropmats four
	{2367.7493,2759.4209,10.8203}, //dropmats five
	{1882.1393,721.3551,10.8203}, //dropmats six
	{870.1201,-25.4718,63.9474} //dropmats seven
};
And then this is in my /getmats command:

Код:
new rand = random(sizeof(DROPMATS));
SetPlayerCheckpoint(playerid, DROPMATS[rand][0], DROPMATS[rand][1], DROPMATS[rand][2], 3);
And when it gives me a random checkpoint, I also want it to send the player a message corresponding to the co-ordinates it picked.

So for example:

If the co-ordiantes randomly selected where [-1322.2762,2498.0610,87.0469], that is Aldea Malvade, so when it is randomly selected, it would set their checkpoint and then:

Код:
SendCleintMessage(playerid, 1, "The package reads Aldea Malvade. Deliver it to the red marker.");
How would I do that?
Reply


Messages In This Thread
Solved [Ignore this thread] - by Ciarannn - 11.01.2015, 18:05
Re: Quick [Random] Question - by Kruno88 - 11.01.2015, 18:10
Re: Quick [Random] Question - by Ciarannn - 11.01.2015, 18:30
Re: Quick [Random] Question - by liquor - 11.01.2015, 19:12
Re: Quick [Random] Question - by Ciarannn - 11.01.2015, 20:24
Re: Quick [Random] Question - by liquor - 11.01.2015, 21:22

Forum Jump:


Users browsing this thread: 1 Guest(s)