/kick help
#1

I've been doing a kick command but its strange that the sendclientmessagetoall is being processed AFTER the Kick(targetid). Anyone how to fix this?
Код:
CMD:kick(playerid, params[]) {
	if(!IsPlayerAdmin(playerid)) {
	    new targetid;
	    new reason[128];
	    new string[256];
	    new pName[MAX_PLAYER_NAME];
	    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "That player isn't connected.");
	    if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /kick [id] [reason]");
		if(!sscanf(params, "us[128]", targetid, reason)) {
		    GetPlayerName(targetid, pName, sizeof(pName));
		    format(string, sizeof(string), "Server Admin(-1) has kicked %s(%d) < > Reason: %s", pName, targetid, reason);
		    SendClientMessageToAll(COLOR_YELLOW, string);
		    Kick(targetid);
		    }
		} else {
		    SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
		}
	return 1;
	}
Reply


Messages In This Thread
/kick help - by jamjamnewbie - 17.05.2014, 00:32
Re : /kick help - by Ramoboss - 17.05.2014, 01:12
Re: /kick help - by Dignity - 17.05.2014, 01:15
Re : /kick help - by Ramoboss - 17.05.2014, 01:28
Re: /kick help - by rymax99 - 17.05.2014, 01:51

Forum Jump:


Users browsing this thread: 1 Guest(s)