Admin chat
#1

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

Your params are "ui", why not "s"?
Reply
#3

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.
Reply
#4

Nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)