SA-MP Forums Archive
"Warning 209: function "cmd_enter" should return a value." Urgent help needed! - 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: "Warning 209: function "cmd_enter" should return a value." Urgent help needed! (/showthread.php?tid=282352)



"Warning 209: function "cmd_enter" should return a value." Urgent help needed! - pEar - 10.09.2011

Alright, so basically I'm trying to make /enter and /exit's instead of using the yellow markers. As of now I've got the info sign that says "/enter to enter", or something. Anyhow, when I do the command it self, I get the warning "warning 209: function "cmd_enter" should return a value", as well as "warning 209: function "cmd_exit" should return a value". I'm using zcmd by the way.

This is the commands:
Code:
COMMAND:enter(playerid,params[])
{
	if(IsPlayerInRangeOfPoint(playerid,10,1552.6899,-1675.4779,16.1953))
	            {
	                SetPlayerPos(playerid,246.3839,109.0597,1003.2188);
	                return 1;
	            }
}

COMMAND:exit(playerid,params[])
{
	if(IsPlayerInRangeOfPoint(playerid,10,246.3839,109.0597,1003.2188))
	            {
	                SetPlayerPos(playerid,1552.6899,-1675.4779,16.1953);
	                return 1;
	            }
	        //other exit commands go here if(player......
}
Fyi, I'm a total noob, so will probably need quite detailed information/help.

Thanks a lot.


Re: "Warning 209: function "cmd_enter" should return a value." Urgent help needed! - =WoR=Varth - 10.09.2011

pawn Code:
COMMAND:enter(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,10,1552.6899,-1675.4779,16.1953))
                {
                    SetPlayerPos(playerid,246.3839,109.0597,1003.2188);
                   
                }
      return 1;//Should be just before command closing bracket
}



Re: "Warning 209: function "cmd_enter" should return a value." Urgent help needed! - pEar - 10.09.2011

Oh god... Such a small mistake, and it... Thanks a lot! Told you I were a n00b.


Re: "Warning 209: function "cmd_enter" should return a value." Urgent help needed! - [M]onsieur - 10.09.2011

pawn Code:
COMMAND:enter(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,10,1552.6899,-1675.4779,16.1953))
    {
        SetPlayerPos(playerid,246.3839,109.0597,1003.2188);
    }
    return true;
}

COMMAND:exit(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,10,246.3839,109.0597,1003.2188))
    {  
        SetPlayerPos(playerid,1552.6899,-1675.4779,16.1953);
   
    }
    return true;
}