SA-MP Forums Archive
HELP! REP+ Should be easy! - 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! REP+ Should be easy! (/showthread.php?tid=444734)



HELP! REP+ Should be easy! - Songason - 18.06.2013

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



Respuesta: HELP! REP+ Should be easy! - Parka - 18.06.2013

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



Re: HELP! REP+ Should be easy! - Enforcer501 - 18.06.2013

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


Re: HELP! REP+ Should be easy! - Songason - 18.06.2013

Thanks - I understand.


Re: HELP! REP+ Should be easy! - Enforcer501 - 18.06.2013

Not a problem


Re: HELP! REP+ Should be easy! - Songason - 18.06.2013

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


Re: HELP! REP+ Should be easy! - San1 - 18.06.2013

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



Re: HELP! REP+ Should be easy! - Enforcer501 - 18.06.2013

Код:
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.


Re: HELP! REP+ Should be easy! - Songason - 18.06.2013

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


Re: HELP! REP+ Should be easy! - Songason - 18.06.2013

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