SA-MP Forums Archive
Simple teleport command error - 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: Simple teleport command error (/showthread.php?tid=171145)



Simple teleport command error - Vilt™ - 25.08.2010


2 Errors.

pawn Код:
#include <a_samp>

forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0x00BCFFFF,"_________[Help Command Text]_________");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line1_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line2_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line3_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line4_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line5_________________|");

        return 1;
    }
    if(strcmp(cmdtext, "/enter", true, 10)==0)
    {
        if(PlayerToPoint(3.0,playerid,413,1700,-2249.9922))
        {
            SendClientMessage(playerid,0x00ABFFFF,"Welcome to the LAPD");
            SetPlayerInterior(playerid, 14);
            SetPlayerPos(playerid,1550.9105,-1683.8849,1723.1050);
            return 1;
        }
    }
    if(strcmp(cmdtext, "/exit", true, 10)==0)
    {
        if(PlayerToPoint(3.0,playerid,1550.9105,-1683.8849,1723.1050))
        {
            SetPlayerPos(playerid,413,1700,-2249.9922);
            return 1;
        }
    }
    return 0;
}
Why do I get that problem?


Re: Simple teleport command error - speediekiller2 - 25.08.2010

ok hy here i have the script you need to use this

[SCRIPT] if(!strcmp("/enter", cmdtext, true))
{
if(IsPlayerAdmin(playerid)==1)
{
SetPlayerPos(playerid, -2277.5476, 471.9923, 78.4079); //playerid,and than the coords
SetPlayerFacingAngle(playerid, 118.0004); // wher the player looks
SendClientMessage(playerid,0x050CFAFF, "You Are Teleported");
return 1;
}
}[/SCRIPT]


Re: Simple teleport command error - Mystique - 25.08.2010

Use IsPlayerInRangeOfPoint instead of PlayerToPoint...


Re: Simple teleport command error - Jeffry - 25.08.2010

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0x00BCFFFF,"_________[Help Command Text]_________");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line1_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line2_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line3_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line4_________________|");
        SendClientMessage(playerid,0x00BCFFFF,"|_____________Line5_________________|");

        return 1;
    }
    if(strcmp(cmdtext, "/enter", true, 10)==0)
    {
        if(IsPlayerInRangeOfPoint(playerid,3.0,413,1700,-2249.9922))
        {
            SendClientMessage(playerid,0x00ABFFFF,"Welcome to the LAPD");
            SetPlayerInterior(playerid, 14);
            SetPlayerPos(playerid,1550.9105,-1683.8849,1723.1050);
            return 1;
        }
    }
    if(strcmp(cmdtext, "/exit", true, 10)==0)
    {
        if(IsPlayerInRangeOfPoint(playerid,3.0,1550.9105,-1683.8849,1723.1050))
        {
            SetPlayerPos(playerid,413,1700,-2249.9922);
            return 1;
        }
    }
    return 0;
}
And remove the forward PlayerToPoint thingy. No need anymore.
I hope it works.

Greetz.


Re: Simple teleport command error - Vilt™ - 25.08.2010

I don't know if it works, because when I login, It says: Stay within the world bounders :S.
what can that be?


Re: Simple teleport command error - Jeffry - 25.08.2010

Anywhere in your code is:
SetPlayerWorldBounds

This is the cause of the message. Just check the code for this.


Re: Simple teleport command error - Vilt™ - 25.08.2010

Hmm, There is no SetPlayerWorldBounds

Do I have to forward that?


Re: Simple teleport command error - Jeffry - 25.08.2010

No. Do you have any Filterscripts loaded? If yes, check them.


Re: Simple teleport command error - Mr.Obscure - 25.08.2010

try it:
pawn Код:
#include <float>



Re: Simple teleport command error - WillyP - 25.08.2010

Quote:
Originally Posted by speediekiller2
Посмотреть сообщение
ok hy here i have the script you need to use this

[SCRIPT] if(!strcmp("/enter", cmdtext, true))
{
if(IsPlayerAdmin(playerid)==1)
{
SetPlayerPos(playerid, -2277.5476, 471.9923, 78.4079); //playerid,and than the coords
SetPlayerFacingAngle(playerid, 118.0004); // wher the player looks
SendClientMessage(playerid,0x050CFAFF, "You Are Teleported");
return 1;
}
}[/SCRIPT]
fail

.