/warn problem
#1

Ive this /warn code, but when i warn someone its doesnt show the reason i gave...


Why?


Код:
  if(strcmp(cmd,"/warn",true)==0)
	{
   if(PlayerInfo[playerid][pAdmin] >= 2)
  	tmp = strtok(cmdtext, idx);
  	new otherplayer = ReturnUser(tmp);
  	if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /warn [playerid] [reason]");
 		if(otherplayer == playerid) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You can't warn yourself !");
	  if(PlayerInfo[otherplayer][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You can't warn Admins!");
		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)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /warn [playerid] [reason]");
		if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
		new year, month, day;
		getdate(year, month, day);
		PlayerInfo[otherplayer][pWarns] ++;
		format(string, sizeof(string), "%s was warned by Administrator %s, Reason: (%s)", giveplayer, sendername, PlayerInfo[playerid][pWarns], (result));
		SendClientMessageToAll(COLOR_RED, string);
		return 1;
	}
Reply


Messages In This Thread
/warn problem - by Taz86 - 03.04.2009, 22:52
Re: /warn problem - by MenaceX^ - 03.04.2009, 23:15
Re: /warn problem - by Taz86 - 03.04.2009, 23:19
Re: /warn problem - by MenaceX^ - 03.04.2009, 23:20
Re: /warn problem - by Taz86 - 03.04.2009, 23:39
Re: /warn problem - by Donvalley - 03.04.2009, 23:41
Re: /warn problem - by Taz86 - 03.04.2009, 23:42
Re: /warn problem - by Donvalley - 03.04.2009, 23:44
Re: /warn problem - by MenaceX^ - 03.04.2009, 23:52
Re: /warn problem - by Taz86 - 03.04.2009, 23:53
Re: /warn problem - by Donvalley - 03.04.2009, 23:54
Re: /warn problem - by Taz86 - 03.04.2009, 23:54
Re: /warn problem - by Taz86 - 04.04.2009, 00:06
Re: /warn problem - by Donvalley - 04.04.2009, 00:07
Re: /warn problem - by Taz86 - 04.04.2009, 00:10
Re: /warn problem - by ICECOLDKILLAK8 - 04.04.2009, 00:18
Re: /warn problem - by Taz86 - 04.04.2009, 00:26
Re: /warn problem - by scott1 - 15.06.2009, 14:13
Re: /warn problem - by scott1 - 22.06.2009, 10:41
Re: /warn problem - by [FoXX]Ziqui - 08.09.2009, 21:26

Forum Jump:


Users browsing this thread: 3 Guest(s)