29.07.2014, 20:48
I made a command which blocks access from a specific account (/abanaccount). It works fine.
However my question is how would I edit his PlayerInfo[playerid][pAccountBanned] whilst hes offline?
1 = Banned.
0 = Not banned.
Here is the command I scripted which bans the account:
However my question is how would I edit his PlayerInfo[playerid][pAccountBanned] whilst hes offline?
1 = Banned.
0 = Not banned.
Here is the command I scripted which bans the account:
Код:
CMD:abanaccount(playerid,params[]) { if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"{AA3333}ERROR:{FFFFFF} Only administrators may use this command."); { new targetid, reason[128], string[128], string2[128]; if(sscanf(params,"us[128]",targetid,reason)) return SendClientMessage(playerid,-1,"{AA3333}USAGE:{FFFFFF} /abanaccount (id) (reason)"); format(string,128,"{AA3333}AdminWARNING:{FFFFFF} %s attempted to ban your account, for reason: %s.",RemoveUnderScore(playerid),reason); if(PlayerInfo[playerid][pAdmin] < PlayerInfo[targetid][pAdmin] || PlayerInfo[targetid][pAdmin] == 6) return SendClientMessage(targetid,-1,string) && SendClientMessage(playerid,-1,"{AA3333}ERROR:{FFFFFF} You cannot ban that players account."); { PlayerInfo[targetid][pAccountBanned] = 1; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] > 1) { format(string2,128,"{AA3333}AdminWARNING:{FFFFFF} %s has banned %s's account, for reason: %s",RemoveUnderScore(playerid),RemoveUnderScore(targetid),reason); SendClientMessage(i,-1,string2); Kick(targetid); } } } } } return 1; }