23.03.2014, 10:30
So here I show You
can any one add temp ban here :/ i tried but i can't figure it like day-month-year
example :
Код:
enum PlayerInfo { Adisable //User account disabled or not } new pInfo[MAX_PLAYERS][PlayerInfo];
Код:
forward loadaccount_Players_Data(playerid, name[], value[]); public loadaccount_Players_Data(playerid, name[], value[]) { INI_Int("Adisable",pInfo[playerid][Adisable]); return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { new INI:file = INI_Open(Path(playerid)); //will open their file INI_WriteInt(file,"Adisable",pInfo[playerid][Adisable]); INI_Close(file); return 1; }
Код:
INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);//We will load his account's data from user's path if (pInfo[playerid][Adisable] == 1) { pInfo[playerid][Adisable] =1; new str1[128]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,24); format(str1,sizeof(str1),"**KICK: %s (%d) (ACCOUNT DISABLED) Account Disabled", pname, playerid); SendClientMessageToAll(COLOR_HOTPINK, str1); SetPlayerScore(playerid,pInfo[playerid][Scores]);//We will get their score inside of his user's account and we will set it here GivePlayerMoney(playerid,pInfo[playerid][Money]);//As explained above KickWithMessage(playerid,"You Have Been Removed From The Server."); }
Код:
CMD:accountdisable(playerid, params[]) { new TargetID,Reason[64]; if(pInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE""); if(sscanf(params, "us", TargetID, Reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /accountdisable [id] [Reason] [days]"); if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID )) return SendClientMessage(playerid, COLOR_RED, "* Player Is Not Connected."); new targetname[MAX_PLAYER_NAME]; GetPlayerName(TargetID,targetname,24); if(!strcmp(targetname, "dumb_ass", true) || !strcmp(targetname,"Sasuke_Uchiha",true) || !strcmp(targetname,"Xeeshan",true)) return SendClientMessage(playerid, COLOR_RED, "You Can't Disable Owner"); else { pInfo[TargetID][Adisable] =1; new str[128],str1[128],str2[128]; format(str,sizeof(str),"%s (%d) Has Been Disabled By An Admin. Reason: %s", targetname, TargetID, Reason); SendClientMessageToAll(COLOR_HOTPINK, str); format(str1,sizeof(str1),"**KICK: %s (%d) (ACCOUNT DISABLED) Account Disabled", targetname, TargetID); SendClientMessageToAll(COLOR_HOTPINK, str1); format(str2,sizeof(str2),"This Account Has Been Disabled By An Admin"); KickWithMessage(TargetID, str2); print(str); print(str1); } return 1; }
example :
Код:
format(str1,sizeof(str1),"**KICK: %s (%d) (ACCOUNT DISABLED) Account Disabled till : %d-%d-%d", targetname, TargetID,day,month,year); SendClientMessageToAll(COLOR_HOTPINK, str1);