[HELP] Players don't see reason when kicked
#1

Sup, I got a simple kick command and when I'm kicking someone they're saying that they cant see the reason so they cant make a ban appeal on my forums.

Here is my kick command:

Код:
if(strcmp(cmd, "/kick", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "	USAGE: /kick [playerid] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				  if(giveplayerid != INVALID_PLAYER_ID)
				  {
					  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GREY, "	USAGE: /kick [playerid] [reason]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
						KickLog(string);
						Kick(giveplayerid);
						format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
						SendClientMessageToAll(COLOR_ADMINCHAT, string);
						return 1;
					}
					else
					{
  					format(string, sizeof(string), "%d is not an active player.", giveplayerid);
						SendClientMessage(playerid, COLOR_RED, string);
						return 1;
					}
				}
			}
			else
			{
  				SendClientMessage(playerid, COLOR_GREY, "	You are not authorized to use that command.");
    			return 1;
  		}
		}
		return 1;
	}
They basicly cant see this line:

Код:
AdmCmd: %s was kicked by %s, reason: %s
Thanks

Reply
#2

You kick the player before sending him the message

this
pawn Код:
Kick(giveplayerid);
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_ADMINCHAT, string);
should be

pawn Код:
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_ADMINCHAT, string);
Kick(giveplayerid);

Grts Riz

PS: OMG
Reply
#3

Quote:
Originally Posted by Rizard
You kick the player before sending him the message

this
pawn Код:
Kick(giveplayerid);
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_ADMINCHAT, string);
should be

pawn Код:
format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_ADMINCHAT, string);
Kick(giveplayerid);

Grts Riz

PS: OMG
haha, epic fail, didn't notice that, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)