Loop - not working.
#1

Код:
public turfwar()
{
	new rand = random(sizeof(checkpoints));
 	for(new i=0; i<MAX_PLAYERS; i++)
  {
    SetPlayerCheckpoint(i,2,checkpoints[rand][0],0,0,0,5.0);
  }

	SendClientMessageToAll(COLOR_YELLOW,"[INFO] A enemy area is now avaible to take over. Go, find it and take it!");
	SendClientMessageToAll(COLOR_YELLOW,"[INFO] The area is marked on your map! Go there and enter the checkpoint.");
}
Aight I got this to show a checkpoint for everyone, but it doesnt want to show up. I was ID 0 on my test server, maybe thats why?
Reply
#2

You're not using SetPlayerCheckpoint correctly.

SetPlayerCheckpoint(playerid, Float, Float:y, Float:z, Floatize);
Reply
#3

I dont know, Iґve never worked with random before. Thats what I got:

new Float: checkpoints[][4] =
{
{ -18.4717,2349.4331,24.1406 },
{ -439.3994,2229.5598,42.3833 },
{ -793.1042,2772.0095,45.6958 },
{ 637.9069,1686.1379,6.9871 }
};

The public is supposed to take a random checkpoint from there and show it to all players.
Reply
#4

pawn Код:
SetPlayerCheckpoint(i,checkpoints[rand][0],checkpoints[rand][1],checkpoints[rand][2],5.0);
Reply
#5

Try this:

pawn Код:
new Float:checkpoints[4][3] =
{
  {-18.4717, 2349.4331, 24.1406},
  {-439.3994, 2229.5598, 42.3833},
  {-793.1042, 2772.0095, 45.6958},
  {637.9069, 1686.1379, 6.9871}
};

new randomCheckpoint = random(sizeof(checkpoints));
SetPlayerCheckpoint(i, checkpoints[randomCheckpoint][0], checkpoints[randomCheckpoint][1], checkpoints[randomCheckpoint][2], 5.0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)