HELP! REP+ Should be easy!
#1

My error:
Код:
warning 202: number of arguments does not match definition (in line 190)
The code:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/adminroof", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
        {
            SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
            SetPlayerInterior(playerid, 0);
        }
    }
    if(!strcmp(cmdtext, "/admindown", true)) ****LINE 190 IS HERE, PEOPLE, THE ERROR IS HERE IT SAYS****
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 0,1889.0286,-1782.9777,25.7911))
        {
            SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
            SetPlayerInterior(playerid, 0);
        }
    }
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/adminroof", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
        {
            SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
            SetPlayerInterior(playerid, 0);
        }
    }
    if(strcmp(cmdtext, "/admindown", true) == 10 )  
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 0,1889.0286,-1782.9777,25.7911))
        {
            SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
            SetPlayerInterior(playerid, 0);
        }
    }
    return 1;
}
Reply
#3

if(IsPlayerInRangeOfPoint(playerid, 3.0, 0,1889.0286,-1782.9777,25.7911))

Should be
Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1889.0286,-1782.9777,25.7911))
-You added an additional parameter that shouldn't of been there.

This is the syntax:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:X, Float:Y, Float:Z);
Reply
#4

Thanks - I understand.
Reply
#5

Not a problem
Reply
#6

Another problem - It says: SERVER: UNKNOWN COMMAND
If I use /adminroof OR /admindown
Reply
#7

Quote:
Originally Posted by Songason
Посмотреть сообщение
Another problem - It says: SERVER: UNKNOWN COMMAND
If I use /adminroof OR /admindown
Try This

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/adminroof", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
        {
            SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
            SetPlayerInterior(playerid, 0);
            return 1;
        }
    }
    if(strcmp(cmdtext, "/admindown", true) == 10 )  
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 0,1889.0286,-1782.9777,25.7911))
        {
            SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
            SetPlayerInterior(playerid, 0);
            return 1;
        }
    }
    return 1;
}
Reply
#8

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/adminroof", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
        {
            SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
            SetPlayerInterior(playerid, 0);
            return 1;
        }
    }
    if(strcmp(cmdtext, "/admindown", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1889.0286,-1782.9777,25.7911))
        {
            SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
            SetPlayerInterior(playerid, 0);
			return 1;
        }
    }
    return 1;
}
Try this.

EDIT:
@Sam1: Great minds think alike haha. Beat me to it I'll admit though.. Might want to correct the 2nd IsPlayerInRange line, it still has the misplaced parameter discussed earlier in your code.
Reply
#9

Quote:
Originally Posted by San1
Посмотреть сообщение
Try This

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/adminroof", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
        {
            SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
            SetPlayerInterior(playerid, 0);
            return 1;
        }
    }
    if(strcmp(cmdtext, "/admindown", true) == 10 )  
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 0,1889.0286,-1782.9777,25.7911))
        {
            SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
            SetPlayerInterior(playerid, 0);
            return 1;
        }
    }
    return 1;
}
Still says UNKNOWN COMMAND in the game when I do one of the cmds
Reply
#10

Quote:
Originally Posted by Enforcer501
Посмотреть сообщение
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/adminroof", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1847.7333,-1761.9608,13.5469))
        {
            SetPlayerPos(playerid, 1889.0286,-1782.9777,25.7911);//Naar boven
            SetPlayerInterior(playerid, 0);
            return 1;
        }
    }
    if(strcmp(cmdtext, "/admindown", true))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0, 1889.0286,-1782.9777,25.7911))
        {
            SetPlayerPos(playerid, 1847.7333,-1761.9608,13.5469);//Naar beneden
            SetPlayerInterior(playerid, 0);
			return 1;
        }
    }
    return 1;
}
Try this.

EDIT:
@Sam1: Great minds think alike haha. Beat me to it I'll admit though.. Might want to correct the 2nd IsPlayerInRange line, it still has the misplaced parameter discussed earlier in your code.
Still says unknown command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)