Strval
#7

Code:
if(strcmp(cmd, "/kick", true) == 0)
	{
	new string[256];
  new idx;
	new tmp[256];
	new pName2[MAX_PLAYER_NAME];
		tmp = strtok(cmdtext, idx);
  		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reason]");
		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++;
		}
		new player1 = strval(tmp);
		result[idx - offset] = EOS;
		if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reason]");
		if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
		
		GetPlayerName(player1, pName2, sizeof(pName2));
				 format(string,sizeof(string),"%s has been kicked.(Reason: %s)", pName2, result);
		   SendClientMessageToAll(COLOR_ORANGE, string);
		   Kick(player1);
		
  	return 1;
	}
that should work .If there is any bug so tell me and yes iam really sorry i even forgotten your topic.
Reply


Messages In This Thread
Strval - by Jakku - 12.12.2009, 12:06
Re: Strval - by Deat_Itself - 12.12.2009, 12:13
Re: Strval - by Jakku - 12.12.2009, 12:16
Re: Strval - by Jakku - 12.12.2009, 12:17
Re: Strval - by Deat_Itself - 12.12.2009, 12:21
Re: Strval - by Jakku - 12.12.2009, 13:45
Re: Strval - by Deat_Itself - 13.12.2009, 12:57
Re: Strval - by LarzI - 13.12.2009, 12:59
Re: Strval - by Damon_Black - 13.12.2009, 15:28
Re: Strval - by Deat_Itself - 13.12.2009, 15:29

Forum Jump:


Users browsing this thread: 1 Guest(s)