19.08.2012, 15:23
Heey all,
What kind of ban is better to put in my admin console when someone is hacking?
Rangeban?
Is this the right code to range ban someone?
Thanks Admigo
What kind of ban is better to put in my admin console when someone is hacking?
Rangeban?
Is this the right code to range ban someone?
Код:
CMD:rban(playerid, params[]) { if(PlayerInfo[playerid][vLevel] == 3 || IsPlayerAdmin(playerid)) { new targetid, reason[64], string[128], ip[20]; if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "/rban"#COL_GREEN#"[PlayerID/PartOfName] [Reason]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE#"[ERROR]"#COL_LRED#" Player not connected!"); { new pTargetName[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,sizeof(pName)); GetPlayerName(targetid,pTargetName,sizeof(pTargetName)); format(string, sizeof(string), ""#COL_ORANGE#"[SERVER]"#COL_LRED#" Admin %s has Range banned %s: %s", pName, pTargetName, reason); SendClientMessageToAll(COLOR_RED,string); GetPlayerIp(targetid, ip, sizeof(ip)); strdel(ip, strlen(ip)-2, strlen(ip)); format(ip, 128,"%s**", ip); format(ip, 128,"banip %s", ip); SendRconCommand(ip); } } return 1; }