Need Help With Random Teleports
#1

I Wanted to make Random Teleports . Can SOmeone say me what is wrong with this code `?

Код:
new LowRaiderTele[7][1] = {
{"2651.9919,-2010.8934,13.3920"}, //1
{"2663.8245,-2011.0059,13.3913"}, //2
{"2678.0613,-2011.1415,13.3924"}, //3
{"2687.0061,-2011.2264,13.3928"}, //4
{"2647.5950,-1997.2626,13.3920"}, //5
{"2655.5215,-1997.2855,13.3910"}, //6
{"2665.3579,-1997.3137,13.3929"}, //7
};
Reply
#2

pawn Код:
new Float:LowRaiderTele[7][3] = {
{2651.9919,-2010.8934,13.3920}, //1
{2663.8245,-2011.0059,13.3913}, //2
{2678.0613,-2011.1415,13.3924}, //3
{2687.0061,-2011.2264,13.3928}, //4
{2647.5950,-1997.2626,13.3920}, //5
{2655.5215,-1997.2855,13.3910}, //6
{2665.3579,-1997.3137,13.3929}, //7
};
Reply
#3

still error

Код:
 
C:\Users\Kalvi\Desktop\sa-mp\gamemodes\kfsr3.pwn(115) : error 018: initialization data exceeds declared size
Reply
#4

i use this:
Код:
new rand = random(3);
		switch (rand)
		{

		case 0: SetPlayerPos(playerid,X,Y,Z);
		case 1: SetPlayerPos(playerid,X,Y,Z);
		case 2: SetPlayerPos(playerid,X,Y,Z);
		}
way more easy in my opinion
Reply
#5

pawn Код:
new Float:LowRaiderTele[7][3] = {
{2651.9919,-2010.8934,13.3920}, //1
{2663.8245,-2011.0059,13.3913}, //2
{2678.0613,-2011.1415,13.3924}, //3
{2687.0061,-2011.2264,13.3928}, //4
{2647.5950,-1997.2626,13.3920}, //5
{2655.5215,-1997.2855,13.3910}, //6
{2665.3579,-1997.3137,13.3929} //7
};
Use that. I accidentally left an extra comma at the end. Then you can just do this.

pawn Код:
new rand = random(7);
SetPlayerPos(playerid,LowRaiderTele[rand][0],LowRaiderTele[rand][1],LowRaiderTele[rand][2]);
Reply
#6

good but what i use @

SetPlayerPos(playerid,.......); ??
Reply
#7

I just posted it.
Reply
#8

Quote:
Originally Posted by » Kalvi «
good but what i use @

SetPlayerPos(playerid,.......); ??
SetPlayerPos(playerid,X of the X ax, Y of the Y ax, Z of the Z ax);

so replace X with the number of the position where u want to spawn on the X ax
X = Horizontaly
Y = Verticaly
Z = Air
Reply
#9

Thank you banana its working now.
Reply
#10

Quote:
Originally Posted by Danebat
i use this:
Код:
new rand = random(3);
		switch (rand)
		{

		case 0: SetPlayerPos(playerid,X,Y,Z);
		case 1: SetPlayerPos(playerid,X,Y,Z);
		case 2: SetPlayerPos(playerid,X,Y,Z);
		}
way more easy in my opinion
Not when you need to add others places.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)