/warn problem
#9

Quote:
Originally Posted by Jeff_Maxwell
Quote:
Originally Posted by Taz86
Yea I know this, From the GF GM.

Lol Thats what I didnt want.

Thanks all!
This one is works perfect. i use it in my gamemode.
But he doesn't want it..
I think you want that if player has X warns he gets autoban?
pawn Код:
if(!strcmp(cmd,"/warn",true))
{
  if(PlayerInfo[playerid][pAdmin]<2) return SendClientMessage(playerid,COLOR_GREY,"You are not authorized.");
  cmd=strtok(cmdtext, idx);
  new otherplayer = ReturnUser(cmd);
  if(!strlen(cmd)) 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.");
  PlayerInfo[otherplayer][pWarns] ++;
  if(PlayerInfo[otherplayer][pWarns]>5) // If he has more than 5 warnings.
  {
    format(string,sizeof(string),"AdmCmd: %s autobanned. (5 warnings",giveplayer);
    SendClientMessageToAll(COLOR_LIGHTRED,string);
    return Ban(id);
  }
  format(string, sizeof(string), "%s was warned by Administrator %s, Reason: (%s)", giveplayer, sendername, PlayerInfo[playerid][pWarns], (result));
  return SendClientMessageToAll(COLOR_RED, string);
}
Hope I helped
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: 1 Guest(s)