SA-MP Forums Archive
Server:Unknown Command [+rep] - 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)
+--- Thread: Server:Unknown Command [+rep] (/showthread.php?tid=314770)



Server:Unknown Command [+rep] SOLVED - cs_waller - 31.01.2012

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


Re: Server:Unknown Command [+rep] - SpiritEvil - 31.01.2012

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;
}



Re: Server:Unknown Command [+rep] - cs_waller - 31.01.2012

EDIT:WORKED THANKS +1 REP


Re: Server:Unknown Command [+rep] - SpiritEvil - 31.01.2012

Does it still return Unknown Command on chat?


Re: Server:Unknown Command [+rep] - Tanush123 - 31.01.2012

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


Re: Server:Unknown Command [+rep] - SpiritEvil - 31.01.2012

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...


Re: Server:Unknown Command [+rep] - Arnold_Collins - 31.01.2012

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


Re: Server:Unknown Command [+rep] - SpiritEvil - 31.01.2012

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


Re: Server:Unknown Command [+rep] - Tanush123 - 02.02.2012

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


Re: Server:Unknown Command [+rep] - Snowman12 - 02.02.2012

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