SA-MP Forums Archive
Suspect Command not working good - 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: Suspect Command not working good (/showthread.php?tid=390620)



Suspect Command not working good - David (Sabljak) - 07.11.2012

Код:
CMD:su(playerid, params[])
{
	new id, crime;
	new string[128];
	if(sscanf(params, "us", id, crime)) return SendClientMessage(playerid, COLOR_ORANGE, "Koristi: {FFFFFF}/su [ID/Nick] [Zlocin]");
	else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}>> [GRESKA] {FFFFFF}Krivi ID!");
	format(string, sizeof string, "Officer %s reported - %s.", playerid, id); //officer reported player
	SendClientMessage(playerid, 0x9955DEEE, string);
	format(string, sizeof string, "You put wanted on %s reason - %s.", id, crime); // officer put wanted on player with reason
	SendClientMessage(playerid, 0x9955DEEE, string);
	format(string, sizeof string, "**ALL UNITS** %s is wanted for - %s.", id, crime); //Sending message to all officers .... Nick and Reason
	SendFamMessage(1,0x9955DEEE, string);
	SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
	return 1;
}
get this - sscanf warning: Strings without a length are deprecated, please add a destination size.


Re: Suspect Command not working good - cosbraa - 07.11.2012

if(sscanf(params, "us[128]", id, crime))
Pretty sure that is what it is.


Re: Suspect Command not working good - David (Sabljak) - 07.11.2012

Still not working


Re: Suspect Command not working good - PrawkC - 07.11.2012

Your crime variable needs to be a string.


Re: Suspect Command not working good - David (Sabljak) - 07.11.2012

Can you make it? :S


Re: Suspect Command not working good - B-Matt - 07.11.2012

Try this.

PHP код:
if(sscanf(params"us[128]"idstring)) return SendClientMessage(playeridCOLOR_ORANGE"Koristi: {FFFFFF}/su [ID/Nick] [Zlocin]");