Piece of code dont work!
#1

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
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)