Teleport to 4 Position
#1

Helly my friends,
I woul make a DM but i have a problem i will that all the player to 4 other position teleport.
Can anyone help me?
Reply
#2

U mean random spawn?
Reply
#3

Yes
Reply
#4

Can you give me the code??
Код:
C:\Dokumente und Einstellungen\Agakoc\Desktop\YESsdsSS\YESSS.pwn(355) : error 017: undefined symbol "randspawn"
C:\Dokumente und Einstellungen\Agakoc\Desktop\YESsdsSS\YESSS.pwn(354) : warning 204: symbol is assigned a value that is never used: "randspawm"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

pawn Код:
new Float:Spawn1X = <your X coord>;
new Float:Spawn1Y = <your Y coord>;
new Float:Spawn1Z = <your Z coord>;

public OnPlayerSpawn(playerid)
{
 new rand = random(4); //rand can have value from 0 to 3
 if(rand == 0) SetPlayerPos(playerid, Spawn1X, Spawn1Y, Spawn1Z);
 return 1;
}
Do the same for other 3 spawns.
Reply
#6

4 Errors:
Код:
C:\DOKUME~1\Agakoc\LOKALE~1\Temp\Rar$DI49.406\freeroam.pwn(1475) : warning 217: loose indentation
C:\DOKUME~1\Agakoc\LOKALE~1\Temp\Rar$DI49.406\freeroam.pwn(1475) : error 029: invalid expression, assumed zero
C:\DOKUME~1\Agakoc\LOKALE~1\Temp\Rar$DI49.406\freeroam.pwn(1475) : error 029: invalid expression, assumed zero
C:\DOKUME~1\Agakoc\LOKALE~1\Temp\Rar$DI49.406\freeroam.pwn(1475 -- 1476) : warning 215: expression has no effect
C:\DOKUME~1\Agakoc\LOKALE~1\Temp\Rar$DI49.406\freeroam.pwn(1476) : error 001: expected token: ";", but found "new"
C:\DOKUME~1\Agakoc\LOKALE~1\Temp\Rar$DI49.406\freeroam.pwn(1476) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

pawn Код:
new Float:Spawn1X = 657.95;
new Float:Spawn1Y = 2105.79
new Float:Spawn1Z = 60.37;

public OnPlayerSpawn(playerid)
{
 new rand = random(4); //rand can have value from 0 to 3
 if(rand == 0) SetPlayerPos(playerid, Spawn1X, Spawn1Y, Spawn1Z);
 if(rand == 1) SetPlayerPos(playerid, other coords);
 if(rand == 2) SetPlayerPos(playerid, other coords);
 if(rand == 3) SetPlayerPos(playerid, other coords);
 return 1;
}
OR

pawn Код:
//delete those "new"

public OnPlayerSpawn(playerid)
{
 new rand = random(4); //rand can have value from 0 to 3
 if(rand == 0) SetPlayerPos(playerid, 657.95, 2105.79, 60.37);
 if(rand == 1) SetPlayerPos(playerid, other coords);
 if(rand == 2) SetPlayerPos(playerid, other coords);
 if(rand == 3) SetPlayerPos(playerid, other coords);
 return 1;
}
Reply
#8

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
if(!strcmp(cmdtext, "/skroad"))
  {
    SetPlayerPos(playerid, 2208.957031, 3108.475830, 4089.916016);
    SendClientMessage(playerid, 0xDF1818AA , "SKROAD");
    return 1;
  }
if(!strcmp(cmdtext, "/stunt-park"))
  {
    SetPlayerPos(playerid, 2119.0869, -2616.2554, 13.5469);
    SendClientMessage(playerid, 0xDF1818AA , "Stunt-Park");
    return 1;
  }
new Float:Spawn1X = 657.95;
new Float:Spawn1Y = 2105.79
new Float:Spawn1Z = 60.37;

public OnPlayerSpawn(playerid)
{
 new rand = random(4); //rand can have value from 0 to 3
 if(rand == 0) SetPlayerPos(playerid, Spawn1X, Spawn1Y, Spawn1Z);
 if(rand == 1) SetPlayerPos(playerid, other coords);
 if(rand == 2) SetPlayerPos(playerid, other coords);
 if(rand == 3) SetPlayerPos(playerid, other coords);
 return 1;
}
return 0;
}
Ist that wrong?
And i will that only on /big-jump the random spawn is.
I know i must edit "if(rand == 3) SetPlayerPos(playerid, other coords);"
Reply
#9

Have no body an idea?
Reply
#10

First put this at the top of your script

new RandomSpawn[3] = {
Cords,
cords,
cords
};
Right above main


and on playerspawn

new rand = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[rand]);

Then it will randomly pull the three cords you have on the top, to random spawn.

this is what i use.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)