/exit help
#1

Hello there.
I am working on my own server and with help of a tutorial I made an /enter and /exit script.
/enter works perfectly. But /exit does absolutely nothing.

Here's the script:


pawn Код:
if(strcmp("/enter", cmdtext, true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid,2.0, -217.7940,979.1616,19.5038)) // change X Y Z coords
            {
                SetPlayerPos(playerid, 246.783996,63.900199,1003.640625); // change X Y Z coords
                SetPlayerInterior(playerid,6); //change the interior.
            }
            else
            {
                SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to enter!");
            }
        }
        return 1;
    }
    if(strcmp("/exit", cmdtext, true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid,2.0, 246.783996,63.900199,1003.640625))  // change X Y Z coords
            {
                SetPlayerPos(playerid, -217.7940,979.1616,19.5038); // change X Y Z coords
            }
            else
            {
                SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to exit!");
            }
        }
        return 1;
    }
Help would be appreciated since I'm stuck here!
Reply
#2

Because the Exit Command doesn't Return true xDD( return 1; )

PS: Use [pawn ] [ /pawn] Without Spaces for the Code
Reply
#3

What do you mean by that?
Reply
#4

Are you sure you are at the correct range?
Reply
#5

Try this :
pawn Код:
if(strcmp("/exit", cmdtext, true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid,3.0, 246.783996,63.900199,1003.640625))  // change X Y Z coords
        {
            SetPlayerPos(playerid, -217.7940,979.1616,19.5038); // change X Y Z coords
        }
        else  SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to exit!");
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Are you sure you are at the correct range?
Yes, I'm sure.
Reply
#7

dont forget to set SetPlayerInterior(playerid, 0); on exit ^^
Reply
#8

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Try this :
pawn Код:
if(strcmp("/exit", cmdtext, true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid,3.0, 246.783996,63.900199,1003.640625))  // change X Y Z coords
        {
            SetPlayerPos(playerid, -217.7940,979.1616,19.5038); // change X Y Z coords
        }
        else  SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the entrance to exit!");
    }
    return 1;
}
Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
dont forget to set SetPlayerInterior(playerid, 0); on exit ^^
Tried - Doesn't work
Reply
#9

well its not an option u have to put it anyway, but maybe u have another /exit command in your gm or fs
Reply
#10

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
well its not an option u have to put it anyway, but maybe u have another /exit command in your gm or fs
Nope, it's my only /exit command.
I just double checked the script and it all looks legit.
I got the interior coordinates from LSPD, enter works but exit which is supposed to bring you back where you type /enter does not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)