SA-MP Forums Archive
- Help with Enter/Exit Command. - 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: - Help with Enter/Exit Command. (/showthread.php?tid=380321)



- Help with Enter/Exit Command. - Bug. - 24.09.2012

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


Re: - Help with Enter/Exit Command. - zDevon - 24.09.2012

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


Re: - Help with Enter/Exit Command. - trapstar2020 - 24.09.2012

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


Re: - Help with Enter/Exit Command. - clarencecuzz - 24.09.2012

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



Re: - Help with Enter/Exit Command. - trapstar2020 - 25.09.2012

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


Re: - Help with Enter/Exit Command. - clarencecuzz - 25.09.2012

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.