SA-MP Forums Archive
Server: Unknown 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: Server: Unknown command (/showthread.php?tid=389572)



Server: Unknown command - Zerovda - 02.11.2012

Код:
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);
            return 1;
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 2229.5374,-1721.7302,13.5658))
        {
          SetPlayerPos(playerid, 773.579956,-77.096694,1000.655029);//GantonGymEntrance
          SetPlayerInterior(playerid, 7);
          return 1;
        }
        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;
        }
        return 1;
    }
I've tried everything but cant get it to work, I updated sscanf aswell. Yes.. I've used the search button, no I cant find the solution on those threads.

Thanks in advice,


Re: Server: Unknown command - Emmet_ - 02.11.2012

Are you using zcmd?


Re: Server: Unknown command - Zerovda - 02.11.2012

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Are you using zcmd?
Yes, I do. I'm pretty newb so bare with me.


Re: Server: Unknown command - Emmet_ - 02.11.2012

Okay, put this at the bottom of your script:

pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1366.3108,-1279.5417,13.5469))
    {
        SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
        SetPlayerInterior(playerid, 1);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 2229.5374,-1721.7302,13.5658))
    {
        SetPlayerPos(playerid, 773.579956,-77.096694,1000.655029);//GantonGymEntrance      
        SetPlayerInterior(playerid, 7);
        return 1;
    }
    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;    
    }
    return 1;
}



Re: Server: Unknown command - -=Dar[K]Lord=- - 02.11.2012

well isnt he asking in commandtext?

Why did u put:

pawn Код:
if(!strcmp(cmdtext, "/enter", true)) // ! here it should be if (strcmp("/mycommand", cmdtext, true, 10) == 0)
i think try it


Re: Server: Unknown command - Zerovda - 02.11.2012

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Okay, put this at the bottom of your script:

pawn Код:
CMD:enter(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 1366.3108,-1279.5417,13.5469))
    {
        SetPlayerPos(playerid, 286.148986,-40.644397,1001.515625);//AmmunationEntrance
        SetPlayerInterior(playerid, 1);
        return 1;
    }
    if(IsPlayerInRangeOfPoint(playerid, 3.0, 2229.5374,-1721.7302,13.5658))
    {
        SetPlayerPos(playerid, 773.579956,-77.096694,1000.655029);//GantonGymEntrance      
        SetPlayerInterior(playerid, 7);
        return 1;
    }
    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;    
    }
    return 1;
}
Works! Thanks for the help!