03.05.2016, 14:33
Hey guyz sup here i made that offline ban cmd and it work but i want admin must give reason to ban that player
i tried but it isnt working also i wanna add read player file and if he is admin as well dont ban him
code
i tried but it isnt working also i wanna add read player file and if he is admin as well dont ban him
code
PHP код:
CMD:oban(playerid, params[]) {
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /oban [Username] [Reason]");
new string[300],reason[50],adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, adminname, sizeof(adminname));
if(udb_Exists(params)) {
if(1 == dUserINT(params).("banned")) return SendClientMessage(playerid,red,"ERROR: Player is already banned");
CMDMessageToAdmins(playerid,"Oban");
dUserSetINT(params).("Banned",1);
new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
format(string,sizeof(string),"%s has been offline banned by Administrator %s [Reason: %s] [Date: %d/%d/%d] [Time: %d:%d]",params,adminname,reason,day,month,year,hour,minuite);
return SendClientMessage(playerid,blue,string);
} else return SendClientMessage(playerid, red,"ERROR: File doesnt exist, player isnt registered");
} else return SendClientMessage(playerid, red,"ERROR: You need to be RCON to use this command");
}