Raised This Month: $ Target: $400
 0% 

[HELP] create set_task, and small fix


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Trickzz
Member
Join Date: Jun 2011
Old 06-13-2011 , 03:52   [HELP] create set_task, and small fix
Reply With Quote #1

Hello again I need help in the next menu to appear after 15 seconds, after finding on the server. And help make the correct spacing for me either as it is impossible. And if I have a falling out case studies on their language is a chance, these lines can be removed?

And how to make menu items are not used as an option, but simply to display from the first to 4 points

Code:
          if (random_num (1,6) <= 10)
               switch (random_num (1, 100))
PHP Code:
#include <amxmodx>
#include <amxmisc>[/code]
#include <fun>

#define PLUGIN "Your Chance"
#define VERSION "1.0"
#define AUTHOR "Trickz"

#define TAG "[Chance]"

public plugin_init()
{
    
// Данные вашего плагина
    
register_plugin(PLUGINVERSIONAUTHOR)
}

// Создадим функцию, которая будет формировать меню
public My_Menu(id)
{
    
// Сперва необходимо создать переменную для меню, с которой мы будем взаимодействовать в дальнейшем
    
new i_Menu menu_create("\Hi, want to try your luck?""menu_handler")

    
// Теперь добавим некоторые опции для меню
    
menu_additem(i_Menu"\wAll Nades""1"0)
    
menu_additem(i_Menu"\wGravity""2"0)
    
menu_additem(i_Menu"\wSpeed""3"0)
    
menu_additem(i_Menu"\wMoney""4"0)
    
    
menu_additem(i_Menu"\wTry Chance""6"0)
    
menu_additem(i_Menu"\wNext Time""7"0)

    
// Отображение меню игроку
    
set_task(15.0 "menu_display")
 }

// Создадим теперь функцию обработки действий меню
public menu_handler(idmenuitem)
{
    
// Показ меню, спустя 15 секунд
    
menu_display(idi_Menu0)

    
// Теперь создадим переменные, необходимые для получения информации о меню и нажатой опции
    
new s_Data[6], s_Name[64], i_Accessi_Callback

    
// Получаем информацию об опции
    
menu_item_getinfo(menuitemi_Accesss_Datacharsmax(s_Data), s_Namecharsmax(s_Name), i_Callback)

    
// Если посмотреть раньше на использовании menu_additem, то можно увидеть, что мы посылали некоторую информацию
    // В данном случае вся информация - целочисленная
    
new i_Key str_to_num(s_Data)

    
// Теперь найдем, какая именно опция была использована
    
new rand random_num(0,100
         if(
random_num(1,6) <= 10)
              switch(
random_num(1100))
{
    case 
1..50:
    {
         
// My Stuff
    
}

    case 
51..70:
    {
         
// My Stuff
    
}

    case 
71..80:
    {
         
// My Stuff
    
}

    case 
81..90:
    {
         
// My Stuff
    
}

    case 
91..100:
    {
         
// My Stuff
    
}

    
// Уничтожение меню
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

Trickzz 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 23:27.


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