How would i go about doing this..
#1

I'm looking to do a /teleport command for example, But i want it to teleport the player out of 4 locations, Something like

Код:
if(strcmp(cmdtext,"/teleport",true)==0) //knife
{

		SetPlayerPos(playerid,1935.6318,1626.9863,72.2578); // and make four locations.

		
return 1;
}
Reply
#2

Any takers?
Reply
#3

You mean a random location? If yes, then use the switch/case with random function.
Reply
#4

heres a simple way to put it.


Top of your script
Код:
new Float:teleport[][4] =
{
  {CORDS},
  {CORDS},
  {CORDS}
};
then on your command

Код:
SetPlayerPos(playerid,teleport[rand][0],teleport[rand][1],teleport[rand][2]);
Simple
Reply
#5

E:\Country DM\gamemodes\CODM.pwn(454) : error 017: undefined symbol "rand"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#6

sorry forgot some code.

here ya go

Код:
new rand = random(sizeof(teleport));
then below it
set playerpos with the code i gave you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)