- Help with Enter/Exit Command.
#1

I was use this Script /Tutrial
forum.sa-mp.com/showthread.php?p=2136679#post2136679
i add it all i have no errors in Pawno
But when i do enter or exit cmd its says "SERVER:Unknow CMD.

How to fix it Help me!
(( Sorry for Bad English ))
Reply
#2

Quote:
Originally Posted by zDevon
Посмотреть сообщение
Try returning 1 inside the command.
____
Reply
#3

are u inrange of where u want to enter/exit? cuz u have Messages telling u ur not there so i guess ur not in the area
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1284.6202,-1585.2909,13.5469))
see that if the player isnt 3foot steps away from the position u cannot enter

REP++
Reply
#4

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
are u inrange of where u want to enter/exit? cuz u have Messages telling u ur not there so i guess ur not in the area
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1284.6202,-1585.2909,13.5469))
see that if the player isnt 3foot steps away from the position u cannot enter

REP++
Did you even read what the problem was?

Change this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1366.3108,-1279.5417,13.5469))
        {
            SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
            SetPlayerInterior(playerid, 1);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2229.5374,-1721.7302,13.5658))
        {
          SetPlayerPos(playerid, 773.579956,-77.096694,1000.655029);//GantonGymEntrance
          SetPlayerInterior(playerid, 7);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1284.6202,-1585.2909,13.5469))
        {
            SetPlayerPos(playerid, -2029.798339,-106.675910,1035.171875);//LicenseCenterEntrance
            SetPlayerInterior(playerid, 3);
        }
    }
    if(!strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 1366.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 1366.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 773.579956,-77.096694,1000.655029))
        {
            SetPlayerPos(playerid, 2229.5374,-1721.7302,13.5658);//GantonGymExit
            SetPlayerInterior(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -2029.798339,-106.675910,1035.171875))
        {
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1284.6202,-1585.2909,13.5469);//LicenseCenterExit
        }
    }
    return 1;
}
To this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/enter", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1366.3108,-1279.5417,13.5469))
        {
            SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
            SetPlayerInterior(playerid, 1);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2229.5374,-1721.7302,13.5658))
        {
          SetPlayerPos(playerid, 773.579956,-77.096694,1000.655029);//GantonGymEntrance
          SetPlayerInterior(playerid, 7);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1284.6202,-1585.2909,13.5469))
        {
            SetPlayerPos(playerid, -2029.798339,-106.675910,1035.171875);//LicenseCenterEntrance
            SetPlayerInterior(playerid, 3);
        }
        return 1;
    }
    if(!strcmp(cmdtext, "/exit", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 1366.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.148986,-40.644397,1001.515625))
        {
            SetPlayerPos(playerid, 1366.3108,-1279.5417,13.5469);//AmmunationExit
            SetPlayerInterior(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 773.579956,-77.096694,1000.655029))
        {
            SetPlayerPos(playerid, 2229.5374,-1721.7302,13.5658);//GantonGymExit
            SetPlayerInterior(playerid, 0);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, -2029.798339,-106.675910,1035.171875))
        {
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1284.6202,-1585.2909,13.5469);//LicenseCenterExit
        }
        return 1;
    }
    return 0;
}
Reply
#5

i proberly miss understood but u forgot to return /enter in the first version
Reply
#6

Neither of them had values being returned, the poster of the thread just didn't include it. Although he had return 1 in his OnPlayerCommandText, he wasn't considering if people were only going to copy the commands, so this is how he should have done it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)