SA-MP Forums Archive
Piece of code dont work! - 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: Piece of code dont work! (/showthread.php?tid=127640)



Piece of code dont work! - sean5874 - 14.02.2010

Hello,
I've made an '/report' command, but the code dont work. If you write '/report Johan_Shitface is a fcking noob', you receive a UNKNOWN COMMAND. If you write '/report' only it works, but you cant write anyting behind it, so this function is pretty useless. Below you can see the code:

Код:
if(strcmp(cmdtext, "/report", true, 10)==0)
	{
		rp[playerid] = GetTickCount();
		new str[128];
		new pname[MAX_PLAYER_NAME];
 		GetPlayerName(playerid, pname, sizeof (pname));
		format(str, 128, "* REPORT: %s Sender: %s (%d)", cmdtext[7],pname,playerid);
		for(new i; i<MAX_PLAYERS; i++)
		{
			if(IsPlayerAdmin(playerid))
			{
				SendClientMessage(i, PM_INCOMING_COLOR, str);
			}
		}
		return 1;
}
Who knows a solution for this?
Greetz,
sean5874


Re: Piece of code dont work! - Lightning[SV] - 14.02.2010

Heres the solution https://sampwiki.blast.hk/wiki/Strtok