SA-MP Forums Archive
Weird OnPlayerCommandText errors [FIXED] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Weird OnPlayerCommandText errors [FIXED] (/showthread.php?tid=113820)



Weird OnPlayerCommandText errors [FIXED] - _Vortex - 16.12.2009

I'm getting these weird errors when I add a dcmd command under onplayercommandtext

Код:
C:\Users\Damien\Desktop\samp server 0.3\gamemodes\SFTDM.pwn(249) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Damien\Desktop\samp server 0.3\gamemodes\SFTDM.pwn(250) : error 078: function uses both "return" and "return <value>"
code:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid,0);
		return 1;
	}
	dcmd(me, 2, cmdtext); // 249
	return 0; // 250
}
I'm not sure what the problem is, because I've never had this problem before :S


Re: Weird OnPlayerCommandText errors [FIXED] - dice7 - 16.12.2009

Do you have dcmd defined ?