Quote:
Originally Posted by MenaceX^
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 
|
that is in my code that if they have 3 warnings the get banned.
Код:
if(PlayerInfo[giveplayerid][pWarns] >= 3)
{
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s was banned by %s (had 3 Warnings), reason: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
PlayerInfo[giveplayerid][pLevel] = -999;
Ban(giveplayerid);
return 1;
}