Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- public plugin_init() {
- register_plugin("RateMap", "1.0", "NiK") // small edit by DecaK
- register_menucmd(register_menuid("RateMap_menu"),1023,"RateMap");
- }
- public client_connect(id) {
- set_task(10.0, "RateMapMenu", id)
- set_task(20.0, "UgasiRateMapMenu", id)
- }
- public RateMapMenu(id) {
- new mapname [32]
- get_mapname(mapname,31)
- static MenuBody[128];
- {
- new len = format(MenuBody,127,"RateMap:Ocenite mapu: %s", mapname);
- len += format(MenuBody[len],127-len,"^n1. Dobra");
- len += format(MenuBody[len],127-len,"^n2. Onako");
- len += format(MenuBody[len],127-len,"^n3. Losa");
- }
- new keys = MENU_KEY_1|MENU_KEY_2;
- show_menu(id,keys,MenuBody,-1,"RateMap_menu");
- }
- public RateMap(id,key)
- {
- switch(key)
- {
- case 0:
- {
- new mapname [32]
- new name[32]
- new logmsg[97]
- get_mapname(mapname,31)
- get_user_name(id, name, 31)
- format(logmsg, 96, "%s (Mapa: %s) je glasao ^"Dobra^".", name, mapname)
- write_file("ratemap.txt", logmsg)
- client_print(id, print_chat, "RateMap by NiK")
- }
- case 1:
- {
- new mapname [32]
- new name[32]
- new logmsg[97]
- get_mapname(mapname,31)
- get_user_name(id, name, 31)
- format(logmsg, 96, "%s (Mapa: %s) je glasao ^"Onako^".", name, mapname)
- write_file("ratemap.txt", logmsg)
- client_print(id, print_chat, "RateMap by NiK")
- }
- case 2:
- {
- new mapname [32]
- new name[32]
- new logmsg[97]
- get_mapname(mapname,31)
- get_user_name(id, name, 31)
- format(logmsg, 96, "%s (Mapa: %s) je glasao ^"Losa^".", name, mapname)
- write_file("ratemap.txt", logmsg)
- client_print(id, print_chat, "RateMap by NiK")
- }
- }
- }
- public UgasiRateMapMenu(id) {
- menu_destroy(id);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement