#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <colorchat>
#include <fakemeta_util>
#define TAG "Rule"
public plugin_init()
{
register_plugin("Ruletka", "0.1", "aS");
register_clcmd("say /ruletka", "ShowMenu", _, "Otwiera menu z kontaktem do Administracji");
}
public ShowMenu(id)
{
new menu = menu_create("Menu ruletki \r by aS", "mh_MyMenu");
menu_additem(menu, "\wLosuj", "", 0); // case 0
menu_addblank(menu, 2); // slot 2
menu_additem(menu, "\rInformacje o pluginie", "", 0); // case 1
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(menu, MPROP_BACKNAME, "Wroc");
menu_setprop(menu, MPROP_NEXTNAME, "Dalej");
menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");
menu_setprop(menu, MPROP_NUMBER_COLOR, "\w");
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public mh_MyMenu(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new command[6], name[64], access, callback;
menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch(item)
{
case 0: {
Poprawne_losowanie(id)
}
case 1: {
new name[33];
get_user_name(id, name, 32);
ColorChat(id, NORMAL, "============= ^x04spatrioci.pl^x01 =============")
ColorChat(id, NORMAL, " Plugin wykonal^x04 aS")
ColorChat(id, NORMAL, " %s Wybierz 1 opcje z menu, aby wylosowac dodatek", name)
ColorChat(id, NORMAL, " Mozesz wylosowac:^x04 Grawitacje, HP, kamizelke")
ColorChat(id, NORMAL, "============= ^x04spatrioci.pl^x01 =============")
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public Poprawne_losowanie(id)
{
switch(random_num(1, 4))
{
case 1:
{
set_hudmessage(0, 255, 0, 0.28, 0.38, 0, 6.0, 3.0)
show_hudmessage(id, "Dostales +50 hp - Wylosowales 1!")
set_user_health(id, get_user_health(id)+50)
}
case 2:
{
set_hudmessage(255, 0, 0, 0.28, 0.38, 0, 6.0, 3.0)
show_hudmessage(id, "Dostales Flesza - Wylosowales 2!")
fm_give_item(id, "weapon_flashbang")
}
case 3:
{
set_hudmessage(255, 255, 255, 0.28, 0.38, 0, 6.0, 3.0)
show_hudmessage(id, "Dostales HE - Wylosowales 3!")
fm_give_item(id, "weapon_hegrenade")
}
case 4:
{
new name[33];
get_user_name(id, name, 32);
ColorChat(id, NORMAL,"%s, dostales +50 kamizelki! ^x01 Tworca pluginu jest ^x04 'aS'", name);
set_user_armor(id, get_user_armor(id)+50)
}
}
}