Raised This Month: $209 Target: $400
 52% 

need help [Days]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
robi
BANNED
Join Date: Mar 2011
Old 03-05-2011 , 08:17   need help [Days]
Reply With Quote #1

hi i need help to mi plugin
Drop-down list and click on something it does not do anything
Who can fix it?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <fakemeta_util>
#include <nvault>
#include <colorchat>

#define VERSION "2.0"

new const PREFIX[] = "[ JailBreak ]^x04" // Prefix 
new g_max_clients        //client check

new specialday[21]
enum
{
DAY_NONE,
DAY_MUSIC,
DAY_GRAV,
DAY_FREEDAY,
DAY_ZOMBIE,
DAY_LAVA,
DAY_SHARK,
DAY_CAGE,
DAY_DM,
DAY_NIGHT,
DAY_SPARTAN
}
    

////////////////////////////////////////////////////////////
//-----------------ROUND END/ ROUND START-----------------//
////////////////////////////////////////////////////////////
public Event_Roundend()
{
    {
        
server_cmd("sv_gravity 800")
    }

    if(
specialday[20] == DAY_DM)
    {
        
server_cmd("mp_friendlyfire 0")
    }
    
client_cmd(0"mp3 stop")
    
client_cmd(0"stopsound")
    }
    {
}

//////////////
// =Stocks= //
//////////////

stock check_user(index)
{
    if(!
is_user_connected(index) ||(is_user_bot(index)))
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

stock strip_weapons(index)
{

    
strip_user_weapons(index)
    
give_item(index"weapon_knife")



//////////////////////////////////////////////////////////////
//---------------PLUGIN INIT--------------------------------//
//////////////////////////////////////////////////////////////

public plugin_init()
{
    
register_plugin("DaysMenu"VERSION"robi")
    
    
//client commands
    
register_clcmd("say /days""specialday_menu")

    
//Other Things
}


////////////////
// =Booleans= //
////////////////
new boolcan_have_gun[33]      // Can he have a gun?


// Sounds
new musicday_song[]     = "sound/kisaot1.mp3"
new musicday_song2[]     = "sound/kisaot2.mp3"
new musicday_song3[]    = "sound/kisaot3.mp3"
new zombiesound[]         = "sound/jailbreak/zombie_day.mp3"


///////////////
// =Defines= //
///////////////


#define IsPlayer(%1) (1<=%1<=g_max_clients)

#define REQUIRED_ADMIN_LEVEL ADMIN_KICK
#define ADMIN_VOICE ADMIN_MENU
#define USE_CC

#if defined USE_CC
#endif
#define OFFSET_PRIMARYWEAPON        116 

/*=====================================================================
The Days Menu
=====================================================================*/

public specialday_check(id)
{
    if(
get_user_team(id) != 2)
    {
        
#if defined USE_CC
            
ColorChat(idRED"%s Only^x03 CT's^x04 can start a^x03 special day"PREFIX)
        
#else
            
client_print(idprint_chat"%s Only CT's can start a special day"PREFIX)
        
#endif
        
        
return PLUGIN_HANDLED
    
}
    
    if(!
is_user_alive(id))
    {    
        
#if defined USE_CC
            
ColorChat(idRED"%s You have to be^x03 alive^x04 to start a^x03 special day"PREFIX)
        
#else
            
client_print(idprint_chat"%s You have to be alive to start a special day"PREFIX)
        
#endif

        
return PLUGIN_HANDLED
    
}
    
set_task(1.0"specialday_menu(id)"0__"b")
    
    return 
PLUGIN_HANDLED
    
}

public 
specialday_menu(id)
{
    new 
specialdaymenu menu_create("ySpecial Days:""specialday_submenu")
    
    
menu_additem(specialdaymenu"wMusic Day""1"0);
    
menu_additem(specialdaymenu"wGravity Day""2"0);
    
menu_additem(specialdaymenu"wFreeday""3"0);
    
menu_additem(specialdaymenu"wZombie Day""4"0);
    
menu_additem(specialdaymenu"wLava Day""5"0);
    
menu_additem(specialdaymenu"wShark Day""6"0);
    
menu_additem(specialdaymenu"wCage Day""7"0);
    
menu_additem(specialdaymenu"wDeathMatch Day""8"0);
    
menu_additem(specialdaymenu"wNight Crawler Day""9"0)
    
menu_additem(specialdaymenu"wSpartan Day""10"0)
        
    
menu_setprop(specialdaymenuMPROP_EXITMEXIT_ALL);
    
menu_display(idspecialdaymenu0);
}
public 
specialday_submenu(idspecialdaymenuitem)
{
    
    if (
item == MENU_EXIT)
    {
        
menu_destroy(specialdaymenu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
Data[7], Name[64];
    new 
AccessCallback;
    
menu_item_getinfo(specialdaymenuitemAccessData,5Name63Callback);
    
    new 
Key str_to_num(Data);
    
    switch (
Key)
    {
        case 
1:
            
specialday[20] = DAY_MUSIC
        
        
case 2:
            
specialday[20] = DAY_GRAV
        
        
case 3:
            
specialday[20] = DAY_FREEDAY
        
        
case 4:
            
specialday[20] = DAY_ZOMBIE
        
        
case 5:
            
specialday[20] = DAY_LAVA
        
        
case 6:
            
specialday[20] = DAY_SHARK
        
        
case 7:
            
specialday[20] = DAY_CAGE
        
        
case 8:
            
specialday[20] = DAY_DM
        
        
case 9:
            
specialday[20] = DAY_NIGHT
        
        
case 10:
            
specialday[20] = DAY_SPARTAN
            
    
}    
    
    if(
IsPlayer(id) && is_user_alive(id))
        
do_specialday(id)
        
    
menu_destroy(specialdaymenu);
    return 
PLUGIN_HANDLED
}

public 
do_specialday(id)
{
    for(new 
0g_max_clientsi++)
    {
        switch(
specialday[20])
        {
            case 
DAY_MUSIC:
            {
                new 
musicmenu menu_create("yMusic Choice""musicday_submenu")
    
                
menu_additem(musicmenu"wPlay Music""1"0)
                
menu_additem(musicmenu"wStop Music""2"0)
    
                
menu_setprop(musicmenu,MPROP_EXITMEXIT_ALL)
                
menu_display(idmusicmenu0)
            }
            
            case 
DAY_GRAV:
            {
                
server_cmd("sv_gravity 200")
            
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is^x03 Gravity day"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is Gravity day"PREFIX)
                
#endif
            
}
            
            case 
DAY_FREEDAY:
            {
                if(
IsPlayer(id) && is_user_alive(id))
                {
                    if(
cs_get_user_team(i) == CS_TEAM_T)
                        
set_user_rendering(ikRenderFxGlowShell25500kRenderNormal16)
                }
                
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is^x03 Freeday"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is Freeday"PREFIX)
                
#endif
            
}
            
            case 
DAY_ZOMBIE:
            {
                if(
IsPlayer(i) && is_user_alive(i))
                {    
                    switch(
cs_get_user_team(i))
                    {
                        case 
CS_TEAM_T:
                        {
                            
set_user_health(i150)
                            
                            
give_item(i"weapon_ak47")
                            
give_item(i"weapon_m4a1")
                            
                            
cs_set_user_bpammo(iCSW_AK4790)
                            
cs_set_user_bpammo(iCSW_M4A190)
                        }
                        
                        case 
CS_TEAM_CT:
                        {
                            if(
is_user_alive(i))
                            {
                                
set_user_health(i500)
                                
can_have_gun[i] = false
                            
}
                        }
                    }
                }
                
                
client_cmd(0"mp3 play ^"%s^""zombiesound)
                
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is^x03 Zombie Day"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is Zombie day"PREFIX)
                
#endif                
            
}
            
            case 
DAY_LAVA:
            {
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is^x03 Lava Day,^x03 Stand on a^x03 spray at all times"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is Lava day, Stand on a spray at all times"PREFIX)
                
#endif
            
}
            
            case 
DAY_SHARK:
            {
                if(
IsPlayer(i) && is_user_alive(i))
                {
                    switch(
cs_get_user_team(i))
                    {
                        case 
CS_TEAM_T:
                        {
                            
set_user_health(i200)
                            
                            
give_item(i"weapon_ak47")
                            
give_item(i"weapon_m4a1")
                            
                            
cs_set_user_bpammo(iCSW_AK4790)
                            
cs_set_user_bpammo(iCSW_M4A190)
                        }
                        
                        case 
CS_TEAM_CT:
                        {
                            if(
is_user_alive(i))
                            {
                                
set_user_noclip(i1)
                                
set_user_health(i300)
                            }
                        }
                    }
                    
                    
#if defined USE_CC
                        
ColorChat(0RED"%s Today is^x03 Shark Day"PREFIX)
                    
#else    
                        
client_print(0print_chat"%s Today is Shark day"PREFIX)
                    
#endif
                
}
            }
                
            case 
DAY_CAGE:
            {
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is cage day"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is a cage day"PREFIX)
                
#endif
            
}
            
            case 
DAY_DM:
            {
                
server_cmd("mp_friendlyfire 1")
                
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is^x03 Deathmatch Day,^x04 Last survivor chooses lr"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is Deathmatch Day, Last survivor chooses lr"PREFIX)
                
#endif
            
}
            
            case 
DAY_NIGHT:
            {
                if(
IsPlayer(i) && is_user_alive(i))
                {    
                    switch(
cs_get_user_team(i))
                    {
                        case 
CS_TEAM_T:    
                        {
                            
give_item(i"weapon_m4a1")
                            
give_item(i"weapon_deagle")
                            
                            
cs_set_user_bpammo(iCSW_M4A190)
                            
cs_set_user_bpammo(iCSW_DEAGLE35)
                        }
                        
                        case 
CS_TEAM_CT:
                        {
                            
strip_weapons(i)
                            
                            
set_user_rendering(ikRenderFxGlowShell000kRenderTransAlpha0)
                            
can_have_gun[i] = false
                        
}
                    }
                }
                
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is a^x03 NightCrawler Day"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is a NightCrawler Day"PREFIX)
                
#endif
            
}
            
            case 
DAY_SPARTAN:
            {
                if(
IsPlayer(i) && is_user_alive(i))
                {
                    switch(
cs_get_user_team(i))
                    {
                        case 
CS_TEAM_T:
                        {
                            
give_item(i"weapon_shield")
                            
give_item(i"weapon_deagle")
                            
                            
cs_set_user_bpammo(iCSW_DEAGLE35)
                        }
                        
                        case 
CS_TEAM_CT:
                        {
                            
give_item(i"weapon_deagle")
                            
give_item(i"weapon_m4a1")
                            
                            
cs_set_user_bpammo(iCSW_DEAGLE35)
                            
cs_set_user_bpammo(iCSW_M4A190)
                        }
                    }
                }
                
                
#if defined USE_CC
                    
ColorChat(0RED"%s Today is^x03 Spartan Day"PREFIX)
                
#else
                    
client_print(0print_chat"%s Today is Spartan Day"PREFIX)
                
#endif
            
}
        }
    }
}

public 
musicday_submenu(idmusicmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(musicmenu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[7], Name[64]
    new 
AccessCallback
    menu_item_getinfo
(musicmenuitemAccessData5Name63Callback)
    
    new 
key str_to_num(Data)
    
    switch(
key)
    {
        case 
1:
        {
            switch(
random_num(13))
            {
                case 
1:
                {
                    
client_cmd(0"mp3 play ^"%s^""musicday_song)
                }
                
                case 
2:
                {
                    
client_cmd(0"mp3 play ^"%s^""musicday_song2)
                }
                case 
3:
                {
                    
client_cmd(0"mp3 play ^"%s^""musicday_song3)
                }
            }
        }
        
        case 
2:
        {
            
client_cmd(0"mp3 stop")
        }
    }
    
menu_display(idmusicmenu0)
    return 
PLUGIN_CONTINUE

Please who can fix it?
Sorry about my English.
robi is offline
Matthias Vance
Senior Member
Join Date: Jan 2009
Old 03-05-2011 , 15:31   Re: need help [Days]
Reply With Quote #2

You've had enough warnings. Creating multiple accounts because your thread is locked is the worst you could have done.

You will be permanently banned.

Re: https://forums.alliedmods.net/showthread.php?t=150314
Matthias Vance is offline
Reply


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 04:19.


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