reason wont appear on chat
#1

I don't know why but when I mute someone it says

"You have muted (name here) for (nothing here)"



Код:
CMD:mute(playerid, params[])
{
    if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
    if(pInfo[playerid][Admin] < 1) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) You don't have the priviliges to use this command.");
	{
	   new target, str[128], name[MAX_PLAYER_NAME], reason[50];
	   if(Mute[target] == 1) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player is already muted!");
	   if(sscanf(params, "us[128]", target, str)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /mute [id] [reason]");
	   if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) That player is not connected");
	   GetPlayerName(target, name,sizeof(name));
	   format(str, sizeof(str), "{EFB509}(INFO) You have muted %s for %s", name, reason);
	   SendClientMessage(playerid, -1, str);
	   
	   format(str, sizeof(str), "{EFB509}(INFO) You have been muted by an admin for: %s", reason);
	   SendClientMessage(target, -1, str);
	   GameTextForPlayer(playerid, "~r~Muted", 4000, 3);
	   Mute[target] = 1;
	}
	return 1;
}
Reply
#2

you have a "str" as reason, so remove the reason[50]; and place str in formats (instead of reasons)
for example:
format(str, sizeof(str), "{EFB509}(INFO) You have muted %s for %s", name, str);

EDIT: noticed too late* u're using str as a main text, so just change if(sscanf(params, "us[128]", target, str)) this str into a reason
if(sscanf(params, "us[128]", target, reason))
Reply
#3

Quote:
Originally Posted by Mugalito
Посмотреть сообщение
you have a "str" as reason, so remove the reason[50]; and place str in formats (instead of reasons)
for example:
format(str, sizeof(str), "{EFB509}(INFO) You have muted %s for %s", name, str);

EDIT: noticed too late* u're using str as a main text, so just change if(sscanf(params, "us[128]", target, str)) this str into a reason
if(sscanf(params, "us[128]", target, reason))
haha thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)