Kod: Tümünü seç
#include <amxmodx>
#define PLUGIN "Menu de Rates"
#define VERSION "1.0"
#define AUTHOR "palitooo"
// Menu keys
const KEYSMENU = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
// Client commands
register_clcmd("say rates", "clcmd_ratemenu")
register_clcmd("say /rates", "clcmd_ratemenu")
// Lang
register_dictionary("rates.txt")
}
public show_menu_rate(id)
{
static menu[250], len
len = 0
// Title
len += formatex(menu[len], sizeof menu - 1 - len, "\y %L^n^n", id, "MENU_TITLE")
// Options
len += formatex(menu[len], sizeof menu - 1 - len, "\r1.\w %L^n", id, "MENU_RATES_2MB")
len += formatex(menu[len], sizeof menu - 1 - len, "\r2.\w %L^n", id, "MENU_RATES_1MB")
len += formatex(menu[len], sizeof menu - 1 - len, "\r3.\w %L^n", id, "MENU_RATES_512KB")
len += formatex(menu[len], sizeof menu - 1 - len, "\r4.\w %L^n", id, "MENU_RATES_256KB")
len += formatex(menu[len], sizeof menu - 1 - len, "\r5.\w %L^n^n", id, "MENU_RATES_128KB")
len += formatex(menu[len], sizeof menu - 1 - len, "\r6.\w %L", id, "MENU_FPS_ENABLED")
// 0. Exit
len += formatex(menu[len], sizeof menu - 1 - len, "^n^n\r0.\w %L", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "Rates")
}
// Rates Menu
public menu_rate(id, key)
{
switch (key)
{
case 1: // 2 Mega Bytes
{
client_cmd(id, "cl_updaterate 101")
client_cmd(id, "cl_cmdrate 101")
client_cmd(id, "rate 25000")
client_print(id, print_chat, "[Rates] %L", LANG_PLAYER, "RATES_2MB")
}
case 2: // 1 Mega Byte
{
client_print(id, print_chat, "[Rates] %L", LANG_PLAYER, "RATES_1MB")
client_cmd(id, "cl_updaterate 80")
client_cmd(id, "cl_cmdrate 80")
client_cmd(id, "rate 20000")
}
case 3: // 512 Kilo Bytes
{
client_print(id, print_chat, "[Rates] %L", LANG_PLAYER, "RATES_512KB")
client_cmd(id, "cl_updaterate 80")
client_cmd(id, "cl_cmdrate 80")
client_cmd(id, "rate 15000")
}
case 4: // 256 Kilo Bytes
{
client_print(id, print_chat, "[Rates] %L", LANG_PLAYER, "RATES_256KB")
client_cmd(id, "cl_updaterate 101")
client_cmd(id, "cl_cmdrate 101")
client_cmd(id, "rate 12000")
}
case 5: // 128 Kilo Bytes
{
client_print(id, print_chat, "[Rates] %L", LANG_PLAYER, "RATES_128KB")
client_cmd(id, "cl_updaterate 60")
client_cmd(id, "cl_cmdrate 60")
client_cmd(id, "rate 10000")
}
case 6: // Fps Enabled
{
client_print(id, print_chat, "[Rates] %L", LANG_PLAYER, "FPS_ENABLED")
client_cmd(id, "cl_showfps 1")
}
}
return PLUGIN_HANDLED
}
// Say "/rates"
public clcmd_ratemenu(id)
{
show_menu_rate(id) // show game menu
}