How would i go about doing this.. - 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: How would i go about doing this.. (
/showthread.php?tid=136645)
How would i go about doing this.. -
xLowrider - 25.03.2010
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;
}
Re: How would i go about doing this.. -
xLowrider - 26.03.2010
Any takers?
Re: How would i go about doing this.. -
Correlli - 26.03.2010
You mean a random location? If yes, then use the switch/case with random function.
Re: How would i go about doing this.. -
-Rebel Son- - 26.03.2010
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
Re: How would i go about doing this.. -
xLowrider - 26.03.2010
E:\Country DM\gamemodes\CODM.pwn(454) : error 017: undefined symbol "rand"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: How would i go about doing this.. -
-Rebel Son- - 26.03.2010
sorry forgot some code.
here ya go
Код:
new rand = random(sizeof(teleport));
then below it
set playerpos with the code i gave you.