Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <amxmisc>
- #include <ColorChat>
- #include <fvault>
- #define PLUGIN "New Plug-In"
- #define VERSION "1.0"
- #define AUTHOR "author"
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd("say /banct", "banct")
- register_clcmd("say !banct", "banct")
- }
- public getbanct(id) {
- new ip[56],skill_key[156],skill_value[156];
- get_user_ip(id, ip, charsmax(ip))
- format(skill_key, charsmax(skill_key), "%s_banct", ip)
- fvault_get_data(skill_key, skill_value , charsmax(skill_value))
- return str_to_num(skill_value)
- }
- public setbanct(id, s_s) {
- new ip[56],skill_key[156],str_t[200];
- get_user_ip(id, ip, charsmax(ip))
- format(skill_key, charsmax(skill_key), "%s_banct", ip)
- format(str_t, charsmax(str_t), "%d", s_s)
- fvault_set_data(exp_vault, skill_key, str_t)
- }
- public banct(id) {
- if (get_user_flags(id) & ADMIN_KICK ) {
- new menu = menu_create("\w[\r CaNoIL \w] BAN CT Menu", "banct_hand");
- new players[32], pnum, tempid;
- new szName[32], szTempid[10], newSz[32*2];
- get_players(players, pnum);
- for( new i; i<pnum; i++ ) {
- tempid = players[i];
- get_user_name(tempid, szName, charsmax(szName));
- if(getbanct(tempid) == 0) {format(newSz, 64, "\r%s \w<\yBAN=CT \r: \yNO>", szName);}
- else if(getbanct(tempid) == 1) {format(newSz, 64, "\r%s \w<\yBAN=CT \r: \yYES>", szName);}
- num_to_str(tempid, szTempid, charsmax(szTempid));
- menu_additem(menu, newSz, szTempid, 0);
- }
- menu_display(id, menu, 0);
- }
- return PLUGIN_HANDLED;
- }
- public banct_hand(id, menu, item) {
- if( item == MENU_EXIT ) {
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- new data[6], szName[64],name[15],name2[15];
- new access, callback;
- menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
- new tempid = str_to_num(data);
- get_user_name(id, name , 14)
- get_user_name(tempid, name2 , 14)
- if (getbanct(tempid) == 0) {
- ColorChat(0, RED, "^1[ ^4%s %s ^1] Admin ^3%s ^4gove ^3BAN-CT ^1to Player ^3%s", name , name2)
- setbanct(tempid, 1)
- }
- else if (getbanct(tempid) == 1) {
- ColorChat(0, RED, "^1[ ^4%s %s ^1] Admin ^3%s ^4removed ^3BAN-CT ^1to Player ^3%s", name , name2)
- setbanct(tempid, 0)
- }
- banct(id)
- return PLUGIN_HANDLED;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement