SA-MP Forums Archive
Admin chat - 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: Admin chat (/showthread.php?tid=488680)



Admin chat - anou1 - 18.01.2014

Hi,

I tried to transform a /a chat command for me but it doesnt work well.


Код:
CMD:a(playerid, params[])
{
	new string[256];
	if(!(pInfo[playerid][Admin] >= 0)) return SendClientMessage(playerid, Rouge, "La commande entrйe est inconnue !");
	if(sscanf(params, "ui", params)) return SendClientMessage(playerid, Rouge, "Utilisation: /a [Votre Message]");
	GetPlayerName(playerid,joueuremetteur,sizeof(joueuremetteur));
	new rangadmin[64];
	if(pInfo[playerid][Admin] == 40) { rangadmin = "Rank 1"; }
	else if(pInfo[playerid][Admin] >= 90) { rangadmin = "Fondateur"; }
	else { rangadmin = "Unknown rank "; }
	
    format(string, 256, "%s  %s: %s", rangadmin, joueuremetteur, params);
    ChannelAdmin(Rouge, string);
	return 1;
}
Код:
public ChannelAdmin(color, string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if (pInfo[i][Admin] >= 1)
		{
			SendClientMessage(i, color, string);
		}
	}
	return 1;
}
When I use this command, everytime, the first letter of the string will be "я"
for exemple if I type /a test
I will have
"Fondateur Belabbas_Anis: яest"


How could I fix this please ?


Re: Admin chat - -Jason - 18.01.2014

Your params are "ui", why not "s"?


Re : Admin chat - anou1 - 18.01.2014

Yeah right, sorry now all work !

But I have this in logs:


sscanf warning: Strings without a length are deprecated, please add a destination size.


EDIT SOLVED.


Re: Admin chat - -Jason - 18.01.2014

Nice