Raised This Month: $ Target: $400
 0% 

Solved Scan Menu Editing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 08-21-2023 , 14:10   Re: Scan Menu Editing
Reply With Quote #3

Quote:
Originally Posted by bigdaddy424 View Post
https://imgur.com/a/2gPdfgd
Code:
#include <amxmodx> #define print(%1,%2) client_print(%1,print_chat,%2) enum _:event_state{     none,     chosen,     submitted } new player_state[MAX_PLAYERS + 1] new scan_id[MAX_PLAYERS + 1][MAX_NAME_LENGTH] new url_matching[] = "google.com/search?q=" new str_state[][] = { "State : \wNone", "State : \yChosen", "State : \rSubmitted" } public plugin_init() {     register_clcmd("say /scan", "clcmd_scan")     register_clcmd("scan_menu", "clcmd_scan")     register_clcmd("say", "clcmd_say") } public client_authorized(id) {     player_state[id] = none     scan_id[id][0] = EOS } public client_disconnected(id) {     if (player_state[id] != none)     {         print(0, "%n left without submitting an url", id)         ban(id)     } } public clcmd_say(id) {     if (player_state[id] != chosen)     {         return PLUGIN_CONTINUE     }     static message[72]     read_args(message, charsmax(message))     remove_quotes(message)     new pos = contain(message, url_matching)     if (pos != -1)     {         player_state[id] = submitted         formatex(scan_id[id], charsmax(scan_id[]), message[pos+strlen(url_matching)])         print(id, "%s", (scan_id[id][0] == EOS) ? "Scan ID cannot be empty" : "Your url has been submitted")         return (scan_id[id][0] == EOS) ? PLUGIN_HANDLED : PLUGIN_CONTINUE     }     else     {         print(id, "Message cannot be sent: provide scan url")         return PLUGIN_HANDLED     } } public clcmd_scan(id) {     new players[MAX_PLAYERS], num, _id     get_players(players, num, "ch")     new menu = menu_create("Scan Menu", "menu_handler")     for (new i = 0; i < num; i++)     {         _id = players[i]         if (player_state[_id] == chosen && id != _id)         {             add_player_to_menu(menu, _id, player_state[_id])         }     }     for (new i = 0; i < num; i++)     {         _id = players[i]         if (player_state[_id] == submitted && id != _id)         {             add_player_to_menu(menu, _id, player_state[_id])         }     }     for (new i = 0; i < num; i++)     {         _id = players[i]         if (player_state[_id] == none && id != _id)         {             add_player_to_menu(menu, _id, player_state[_id])         }     }     menu_display(id, menu) } public menu_handler(id, menu, item) {     if (item != MENU_EXIT)     {         new info[8], temp         menu_item_getinfo(menu, item, temp, info, charsmax(info), "", 0, temp)         new _id = str_to_num(info)         if (is_user_connected(_id))         {             new submenu = menu_create(fmt("Selected \y%n^n\w%s", _id, str_state[player_state[_id]]), "submenu_handler")             switch (player_state[_id])             {                 case none : menu_additem(submenu, "Request scanning", fmt("%d", _id))                 case chosen : menu_additem(submenu, "Lift request", fmt("%d", _id))                 case submitted :                 {                     menu_additem(submenu, "Lift request", fmt("%d", _id))                     menu_additem(submenu, fmt("Scan ID: \y%s", scan_id[_id]), fmt("%d", _id))                 }             }             menu_display(id, submenu)         }     }     menu_destroy(menu) } public submenu_handler(id, menu, item) {     if (item != MENU_EXIT)     {         new info[8], temp         menu_item_getinfo(menu, item, temp, info, charsmax(info), "", 0, temp)         new _id = str_to_num(info)         if (is_user_connected(_id))         {             switch (item)             {                 case none :                 {                     switch (player_state[_id])                     {                         case none :                         {                             player_state[_id] = chosen                             print(0, "%n has asked %n to provide scan url", id, _id)                         }                         case chosen, submitted :                         {                             player_state[_id] = none                             print(_id, "%n has lifted scan request", id)                         }                     }                 }                 case chosen :                 {                     show_motd(id, fmt("http://%s%s", url_matching, scan_id[_id]), fmt("http://%s%s", url_matching, scan_id[_id]))                 }             }         }     }     menu_destroy(menu) } stock add_player_to_menu(menu, const who, const _event_state) {     switch (_event_state)     {         case none : menu_additem(menu, fmt("\w%n", who), fmt("%d", who))         case chosen : menu_additem(menu, fmt("\y%n", who), fmt("%d", who))         case submitted : menu_additem(menu, fmt("\r%n", who), fmt("%d", who))     } } stock ban(const who) {     server_print("banning %n", who)     return who ? true : false }
As i said when admin flag kick choosed player to scan ; 1. Choose Player To Scan
2. View How much player has scanned before if Clean / Cheater
chat will be
!g[Scan Menu] Admin %s Asked %s To Scan.
__________________
Thank You For Helps
Discord:
null.#0096
https://www.youtube.com/@NullHere/

Last edited by SHIFT0; 08-21-2023 at 14:10.
SHIFT0 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode