SA-MP Forums Archive
onplayercommandreceived help - 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: onplayercommandreceived help (/showthread.php?tid=564056)



onplayercommandreceived help - Nabster - 19.02.2015

gives me 3 errors

C:\Users\Trayansh\Desktop\SAMP\gamemodes\register. pwn(359) : error 055: start of function body without function header
C:\Users\Trayansh\Desktop\SAMP\gamemodes\register. pwn(360) : error 010: invalid function or declaration
C:\Users\Trayansh\Desktop\SAMP\gamemodes\register. pwn(364) : error 010: invalid function or declaration

Код:
public OnPlayerCommandReceived(playerid,cmdtext[]);
{
   if(PInfo[playerid][CMuted] == 1)
	{
		format(string,sizeof(string),"You are still muted, You can use all the commands after %d seconds.",PInfo[playerid][CMutedSec]);
	    SendClientMessage(playerid,COLOR_RED,string);
	    return 0;
	}
}



Re: onplayercommandreceived help - CalvinC - 19.02.2015

pawn Код:
public OnPlayerCommandReceived(playerid,cmdtext[]);
Remove the ";", you shouldn't use that with a function/public function title.
Also, you need to define "string", like this:
pawn Код:
new string[size];



Re: onplayercommandreceived help - Nabster - 19.02.2015

Thanks dude,i kept searching for mistake for 10 mins and it was that little semi colon ._.
and yeah i defined that later

"You must spread some reputation around before giving it to Calvin.."