HOLY SHIT ITAILS NEEDS HELP -
RobertGraham - 19.06.2009
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!
Re: HOLY SHIT ITAILS NEEDS HELP -
Abernethy - 19.06.2009
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
Re: HOLY SHIT ITAILS NEEDS HELP -
RobertGraham - 19.06.2009
Код:
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.
Re: HOLY SHIT ITAILS NEEDS HELP -
Grim_ - 19.06.2009
pawn Код:
public OnPlayerCommandText(playerid, [b]cmdtext[][/b])
pawn Код:
if(strcmp([b]cmdtext[/b], "/teleport", true) == 0)
text[] should be cmdtext[]
text should be cmdtext
Re: HOLY SHIT ITAILS NEEDS HELP -
RobertGraham - 19.06.2009
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);
}
}
Re: HOLY SHIT ITAILS NEEDS HELP -
Grim_ - 19.06.2009
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
Re: HOLY SHIT ITAILS NEEDS HELP -
RobertGraham - 19.06.2009
OH, wow, thanks, it works!
Re: HOLY SHIT ITAILS NEEDS HELP -
Delphinus - 19.06.2009
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.
Re: HOLY SHIT ITAILS NEEDS HELP -
Abernethy - 19.06.2009
Lmfao, nice one. You're just gifted for adding the facing angle
Re: HOLY SHIT ITAILS NEEDS HELP -
Delphinus - 19.06.2009
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! >__>