Server: Unknown command
#1

Код:
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,
Reply
#2

Are you using zcmd?
Reply
#3

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

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;
}
Reply
#5

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
Reply
#6

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!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)