SA-MP Forums Archive
/report cannot get a sentence - 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: /report cannot get a sentence (/showthread.php?tid=474834)



/report cannot get a sentence - whando - 09.11.2013

Код:
dcmd_report(playerid,params[])
{
	new string[128];
	new ID;
	new cmdreason[100];
	if(!sscanf(params,"us[100]",ID,cmdreason))
	{
	    SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /report [playerid/PartOfName] (Reason)");
	    return 1;
	}
	if(!IsPlayerConnected(ID))
	{
		format(string,sizeof(string),"That player is not conneted ");
		SendClientMessage(playerid,COLOR_GRAD1,string);
		return 1;
	}
	format(string,sizeof(string),"Your report has been sent!");
	SendClientMessage(playerid,COLOR_YELLOW,string);

	format(string,sizeof(string),"Report: %s(%d) reported: %s(%d): %s.",PlayerName(playerid),playerid,PlayerName(ID),ID, cmdreason);
	ABroadCast(RED, string, 1);
	return 1;
}
Just came back after I didn't script for 3-4 months, still learning etc. Now I made this command, but when I type a reason it only says the first word, how can I still get a full sentence as reason?

Thanks!


Re: /report cannot get a sentence - Pottus - 10.11.2013

Try printing params to verify your data.


Re: /report cannot get a sentence - DeLuca - 10.11.2013

Increase the size of string. Try string[360]; just to see if it works or not.