SA-MP Forums Archive
Teleport to 4 Position - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teleport to 4 Position (/showthread.php?tid=130871)



Teleport to 4 Position - Igdirli 76 - 28.02.2010

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?



Re: Teleport to 4 Position - geerdinho8 - 28.02.2010

U mean random spawn?


Re: Teleport to 4 Position - Igdirli 76 - 28.02.2010

Yes



Re: Teleport to 4 Position - Igdirli 76 - 28.02.2010

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.



Re: Teleport to 4 Position - CaHbKo - 28.02.2010

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.


Re: Teleport to 4 Position - Igdirli 76 - 28.02.2010

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.



Re: Teleport to 4 Position - CaHbKo - 28.02.2010

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;
}



Re: Teleport to 4 Position - Igdirli 76 - 28.02.2010

Код:
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);"


Re: Teleport to 4 Position - Igdirli 76 - 28.02.2010

Have no body an idea?


Re: Teleport to 4 Position - -Rebel Son- - 28.02.2010

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.