Server:Unknown Command [+rep]
#1

Hello guys.I have a big problem.I make /enter and /exit command all si nice but when I type in the chat /exit or /enter the server say's SERVER:UNKNOWN COMMAND but the command teleported me.This is the code.

pawn Код:
if (strcmp(cmdtext, "/enter", true) == 0)
    {
            if(IsPlayerInRangeOfPoint(playerid, 2.0, 2318.7637,-89.8024,26.4844))//palomino general creeck 1
            {
                SetPlayerPos(playerid, -27.5851,-57.2032,1003.5469);
                SetPlayerInterior(playerid, 6);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0,2245.9036,52.0571,26.6671))//palomino general creeck 2
            {
                SetPlayerPos(playerid, -27.5851,-57.2032,1003.5469);
                SetPlayerInterior(playerid, 6);
                SetPlayerVirtualWorld(playerid, 1);

            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0,2245.9036,52.0571,26.6671))//palomino general creeck 2
            {
                SetPlayerPos(playerid ,-27.5851,-57.2032,1003.5469);
                SetPlayerInterior(playerid, 6);
                SetPlayerVirtualWorld(playerid, 2);

            }
    }
    if (strcmp(cmdtext, "/exit", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        {
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerPos(playerid, 2318.7637,-89.8024,26.4844);
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerInterior(playerid, 0);
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerVirtualWorld(playerid, 0);
        return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469))//palomino general creeck 2
        {
        if(GetPlayerVirtualWorld(playerid) == 1)
        SetPlayerPos(playerid, 2245.9036,52.0571,26.6671);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerInterior(playerid, 0);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerVirtualWorld(playerid, 0);

        }
        else if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469))//palomino general creeck 2
        {
        if(GetPlayerVirtualWorld(playerid) == 2)
        SetPlayerPos(playerid, 2245.9036,52.0571,26.6671);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 2 )
        SetPlayerInterior(playerid, 0);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 2 )
        SetPlayerVirtualWorld(playerid, 0);

        }
    }
Thanks in advanced
Reply
#2

Add "return 1;" at the end of each command. So you would have:

pawn Код:
if (strcmp(cmdtext, "/enter", true) == 0)
{
            if(IsPlayerInRangeOfPoint(playerid, 2.0, 2318.7637,-89.8024,26.4844))//palomino general creeck 1
            {
                SetPlayerPos(playerid, -27.5851,-57.2032,1003.5469);
                SetPlayerInterior(playerid, 6);
                SetPlayerVirtualWorld(playerid, 0);
            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0,2245.9036,52.0571,26.6671))//palomino general creeck 2
            {
                SetPlayerPos(playerid, -27.5851,-57.2032,1003.5469);
                SetPlayerInterior(playerid, 6);
                SetPlayerVirtualWorld(playerid, 1);

            }
            else if(IsPlayerInRangeOfPoint(playerid, 2.0,2245.9036,52.0571,26.6671))//palomino general creeck 2
            {
                SetPlayerPos(playerid ,-27.5851,-57.2032,1003.5469);
                SetPlayerInterior(playerid, 6);
                SetPlayerVirtualWorld(playerid, 2);

            }

            return 1;
}


if (strcmp(cmdtext, "/exit", true) == 0)
{
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        {
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerPos(playerid, 2318.7637,-89.8024,26.4844);
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerInterior(playerid, 0);
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerVirtualWorld(playerid, 0);
        return 1;
        }
        else if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469))//palomino general creeck 2
        {
        if(GetPlayerVirtualWorld(playerid) == 1)
        SetPlayerPos(playerid, 2245.9036,52.0571,26.6671);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerInterior(playerid, 0);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 0 )
        SetPlayerVirtualWorld(playerid, 0);

        }
        else if(IsPlayerInRangeOfPoint(playerid, 3.0, -27.0721,-56.7820,1003.5469))//palomino general creeck 2
        {
        if(GetPlayerVirtualWorld(playerid) == 2)
        SetPlayerPos(playerid, 2245.9036,52.0571,26.6671);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 2 )
        SetPlayerInterior(playerid, 0);
        if(IsPlayerInRangeOfPoint(playerid, 2.0, -27.0721,-56.7820,1003.5469)) //Garage 2 umbrella
        if ( GetPlayerVirtualWorld( playerid ) == 2 )
        SetPlayerVirtualWorld(playerid, 0);

        }

        return 1;
}
Reply
#3

EDIT:WORKED THANKS +1 REP
Reply
#4

Does it still return Unknown Command on chat?
Reply
#5

Quote:
Originally Posted by SpiritEvil
Посмотреть сообщение
Does it still return Unknown Command on chat?
He just said it works...
Reply
#6

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
He just said it works...
At first he said it was not working so I asked him, but then he edited the post...
Reply
#7

anyway he didnt give rep check 0 reputation at guy who help
Reply
#8

Quote:
Originally Posted by Arnold_Collins
Посмотреть сообщение
anyway he didnt give rep check 0 reputation at guy who help
I know right! But what can I do :P at least I'm glad I helped
Reply
#9

Quote:
Originally Posted by Arnold_Collins
Посмотреть сообщение
anyway he didnt give rep check 0 reputation at guy who help
sprit got rick rolled?
Reply
#10

seeing as he can't give rep. Of course it will stay at 0.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)