SA-MP Forums Archive
warning 209: function "OnPlayerCommandText" should return a value - 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 "OnPlayerCommandText" should return a value (/showthread.php?tid=507478)



warning 209: function "OnPlayerCommandText" should return a value - Slicebook - 17.04.2014

howto fix warning?

Код:
	if(strcmp(cmd, "/йkutrob", true) == 0)
		{
		if(KutRob != 0) return Msg(playerid, "Nemrйg raboltбk! 15 percenkйnt lehet!");
		if(PlayerToPoint(2, playerid,  -31.1413,-29.0347,1003.5573))
		{
		}
		else
		{
		SendClientMessage(playerid, piri,"(( Nem vagy a kъton, hol akarsz rabolni?! ))");
		return 1;
		}
		{
  	  	SendRadioMessage(LMUNKA_SCPD, TEAM_BLUE_COLOR, "** HНVБS: Folyamatban lйvő rablбs. Egysйget kйrьnk a helyszнnre!",true);
		SendRadioMessage(LMUNKA_SCPD, TEAM_BLUE_COLOR, "** HНVБS: Helyszнn: Benzinkъt-Йszak. Hнvбs kуdszбma: 2",true);
		SendRadioMessage(LMUNKA_SCPD, TEAM_BLUE_COLOR, "** Elkцvető leнrбsa: Ismeretlen",true);	
		///
		SendRadioMessage(LMUNKA_FBI, TEAM_BLUE_COLOR, "** HНVБS: Folyamatban lйvő rablбs. Egysйget kйrьnk a helyszнnre!",true);
		SendRadioMessage(LMUNKA_FBI, TEAM_BLUE_COLOR, "** HНVБS: Helyszнn: Benzinkъt-Йszak. Hнvбs kуdszбma: 2",true);
		SendRadioMessage(LMUNKA_FBI, TEAM_BLUE_COLOR, "** Elkцvető leнrбsa: Ismeretlen",true);	
		//
		SendRadioMessage(LMUNKA_KATONA, TEAM_BLUE_COLOR, "** HНVБS: Folyamatban lйvő rablбs. Egysйget kйrьnk a helyszнnre!",true);
		SendRadioMessage(LMUNKA_KATONA, TEAM_BLUE_COLOR, "** HНVБS: Helyszнn: Benzinkъt-Йszak. Hнvбs kуdszбma: 2",true);
		SendRadioMessage(LMUNKA_KATONA, TEAM_BLUE_COLOR, "** Elkцvető leнrбsa: Ismeretlen",true);	
		///
		SendRadioMessage(LMUNKA_NAV, TEAM_BLUE_COLOR, "** HНVБS: Folyamatban lйvő rablбs. Egysйget kйrьnk a helyszнnre!",true);
		SendRadioMessage(LMUNKA_NAV, TEAM_BLUE_COLOR, "** HНVБS: Helyszнn: Benzinkъt-Йszak. Hнvбs kуdszбma: 2",true);
		SendRadioMessage(LMUNKA_NAV, TEAM_BLUE_COLOR, "** Elkцvető leнrбsa: Ismeretlen",true);	
    	        SendClientMessage(playerid, sargi,"(( Elkezdted rabolni a kutat, vigyбzz, nehogy elkapjanak a rendőrцk! ))");
    	        SendClientMessage(playerid, piri,"(( Lefagyasztunk egy kis időre, ameddig kirabolod a kutat ))");
		new rcash =(random(50000-10000)+10000);
		KutRob = 1;
		SetTimer("KutRablasIdo", 900000, false);
		SetTimerEx("KutRablas", 40000, false, "i", playerid);
	        TogglePlayerControllable(playerid,0);
		Freeze(playerid, 40000);
	        GiveMoney(playerid, rcash);
		return 1;
		}
	}
}



Re: warning 209: function "OnPlayerCommandText" should return a value - Konstantinos - 17.04.2014

Return a value (must be 0 though) as the warning says:
pawn Код:
...
            Freeze(playerid, 40000);
            GiveMoney(playerid, rcash);
            return 1;
        }
    }
    return 0;
}



Re: warning 209: function "OnPlayerCommandText" should return a value - Slicebook - 17.04.2014

thanks konstantinoos! and 1problem help?
Код:
 warning 217: loose indentation
Код:
                        if( listitem == 5)
                        {
							if(Szint(playerid)  < 1) return Msg(playerid, "Minimum 1-es szint.");
							if(!Rejtett[playerid])
							{
								Msg(playerid, "Telefonszбm elrejtve.");
								Rejtett[playerid] = 1;
								return 1;
							} 
								Msg(playerid, "Telefonszбm lбthatу."); <<warning
								Rejtett[playerid] = 0;
								return 1;
							}
						}



Re: warning 209: function "OnPlayerCommandText" should return a value - Konstantinos - 17.04.2014

Learn to intend your code properly. It will help yourself to be able to read your code easily.

Or use an online intender for long code such as: http://codegenerators.pl/


Re: warning 209: function "OnPlayerCommandText" should return a value - Slicebook - 17.04.2014

okey thanks!