HOLY SHIT ITAILS NEEDS HELP
#1

Hey, I need help creating a teleport script.

I have looked at these and I do not understand:
https://sampwiki.blast.hk/wiki/SetPlayerPos
https://sampwiki.blast.hk/wiki/AllowPlayerTeleport

When I insert this code into my PAWN Script, I get errors from hell.

pawn Код:
public OnPlayerCommandText(playerid,text[])
{
  if strcmp(text,"/teleport",true)
  {      
    SetPlayerPos(playerid,0.0,0.0,10.0);
  }
}
This is the position I want to put in, and I don't understand how I'm supposed to insert it.
pawn Код:
AddPlayerClass(0,1708.5780,1606.8759,10.0156,73.0769,0,0,0,0,0,0); // lvairportspawn
Thanks in advance!
Reply
#2

pawn Код:
AddPlayerClass(0,1708.5780,1606.8759,10.0156,73.0769,0,0,0,0,0,0); // lvairportspawn
           X     Y    Z   R
X = East to West
Y = North to South
Z = Up & Down
R = Rotation.

This is the code you want ..
pawn Код:
1708.5780,1606.8759,10.0156
Reply
#3

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\OpenCarnage1-0Revised.pwn(255) : error 025: function heading differs from prototype
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\OpenCarnage1-0Revised.pwn(258) : error 001: expected token: "*then", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
pawn Код:
public OnPlayerCommandText(playerid,text[])
{
  if strcmp(text,"/lvairport",true)
  {
    SetPlayerPos(playerid,1708.5780,1606.8759,10.0156);
  }
}
Still doesn't work.
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, [b]cmdtext[][/b])
pawn Код:
if(strcmp([b]cmdtext[/b], "/teleport", true) == 0)
text[] should be cmdtext[]
text should be cmdtext
Reply
#5

Quote:
Originally Posted by Swift_
pawn Код:
public OnPlayerCommandText(playerid, [b]cmdtext[][/b])
pawn Код:
if(strcmp([b]cmdtext[/b], "/teleport", true) == 0)
text[] should be cmdtext[]
text should be cmdtext
I dont get it, am I supposed to put a command like:

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
  if strcmp(cmdtext,"/lvairport",true)
  {
    SetPlayerPos(playerid,1708.5780,1606.8759,10.0156);
  }
}
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/lsairport", true) == 0)
  {
   SetPlayerPos(playerid, 1708.5780,1606.8759,10.0156);
   return 1;
  }
  return 0;
}
https://sampwiki.blast.hk/wiki/Scripting_Basics
Reply
#7

OH, wow, thanks, it works!
Reply
#8

And for extra points...

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 if(strcmp(cmdtext, "/lsairport", true) == 0)
 {
   SetPlayerPos(playerid, 1708.5780,1606.8759,10.0156);
   SetPlayerFacingAngle(playerid,73.0769);
return 1;
 }
 return 0;
}
That will also set the player looking in whatever direction you like after they teleport.
Reply
#9

Lmfao, nice one. You're just gifted for adding the facing angle
Reply
#10

Quote:
Originally Posted by Abernethy
Lmfao, nice one. You're just gifted for adding the facing angle
I haz talent like dem guyz over dere yeh?



Damn you for mocking me! Curse you to the heavens! You have yet to see the true extent of my power! >__>
Reply


Forum Jump:


Users browsing this thread: