Raised This Month: $ Target: $400
 0% 

Open menu after join server probem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
J4CK
Member
Join Date: Dec 2008
Location: India
Old 01-01-2010 , 18:49   Open menu after join server probem
Reply With Quote #1

i have problem
when player connect, menu auto-open, its ok...

but when connect next player! menu open again on all player who on the server how to fix it?

it my code on (auto-open-menu)

PHP Code:
public client_putinserver(id) { 
    
set_task(3.0"cmdconnectmenuopen"

public 
cmdconnectmenuopen(id) { 
    
client_cmd(id"say /menu"); 

PHP Code:
#include <amxmodx>

#define PLUGIN    "menu_test"
#define AUTHOR    "menu_test"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say /menu""TestConnectMenu")
    
}

public 
client_putinserver(id) {
    
set_task(3.0"cmdconnectmenuopen")
}
public 
cmdconnectmenuopen(id) {
    
client_cmd(id"say /menu");
}

public 
TestConnectMenu(id)
{
    new 
Menu menu_create("\yClimbers Menu""test_show")
    
    
menu_additem(Menu"\wSAY hi (test)""1"0)
    
    
menu_setprop(Menu,MPROP_EXITNAME,"Exit")
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL)
    
    
menu_display(idMenu0)
    
    return 
PLUGIN_HANDLED
}

public 
test_show(idMenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
iData[6]
    new 
iAccess
    
new iCallback
    
new iName[64]
    
    
menu_item_getinfo(MenuitemiAccessiData5iName63iCallback)
    
    switch(
str_to_num(iData))
    {
        case 
1:
        {
            
client_cmd(id"say test-hi-123");
            
TestConnectMenu(id)
        }

    }
    return 
PLUGIN_HANDLED

J4CK is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 01-01-2010 , 19:26   Re: Open menu after join server probem
Reply With Quote #2

[php]public client_putinserver(id) {
set_task(3.0, "cmdconnectmenuopen")
}
[php]

--->
PHP Code:
public client_putinserver(id) { 
    
set_task(3.0"cmdconnectmenuopen"id

Mxnn is offline
cikjam
Senior Member
Join Date: Feb 2009
Location: Australia
Old 01-01-2010 , 23:04   Re: Open menu after join server probem
Reply With Quote #3

Why not Just:

PHP Code:
public client_putinserver(id) { 
    
set_task(3.0"TestConnectMenu"id
__________________
R.I.P Aziz 'Zyzz' Sergeyevich Shavershian
cikjam is offline
J4CK
Member
Join Date: Dec 2008
Location: India
Old 01-01-2010 , 23:22   Re: Open menu after join server probem
Reply With Quote #4

Mxnn, thanks i forgot add "id"
cikjam, for more function when player join

hey guys, how add:
when player push key "M" - open my "TestConnectMenu"

without client_cmd(id, "...
J4CK is offline
cikjam
Senior Member
Join Date: Feb 2009
Location: Australia
Old 01-01-2010 , 23:25   Re: Open menu after join server probem
Reply With Quote #5

Quote:
Originally Posted by J4CK View Post
cikjam, for more function when player join
I don't get it. Why would you want to use more stuff?
__________________
R.I.P Aziz 'Zyzz' Sergeyevich Shavershian
cikjam is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2010 , 04:21   Re: Open menu after join server probem
Reply With Quote #6

Quote:
Originally Posted by J4CK View Post
cikjam, for more function when player join
Yeah . . . that doesn't make any sense.

Quote:
Originally Posted by J4CK View Post
hey guys, how add:
when player push key "M" - open my "TestConnectMenu"

without client_cmd(id, "...
You cannot know what key a player uses. If you are refering to the function that is normally bound to "M" then you should be able to register the client command and have it execute your menu, TestConnectMenu.
__________________
fysiks is offline
AppStore
BANNED
Join Date: Dec 2009
Location: Saladillo
Old 01-02-2010 , 13:03   Re: Open menu after join server probem
Reply With Quote #7

PHP Code:
#include <amxmodx>

#define PLUGIN    "menu_test"
#define AUTHOR    "menu_test"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say /menu""TestConnectMenu")
    
}
public 
client_putinserver(id) {
    
set_task(8.0"cmdconnectmenuopen"id)
}
public 
cmdconnectmenuopen(id) {
    
TestConnectMenu(id)
}

public 
TestConnectMenu(id)
{
    new 
Menu menu_create("\yClimbers Menu""test_show")
    
    
menu_additem(Menu"\wSAY hi (test)""1"0)
    
    
menu_setprop(Menu,MPROP_EXITNAME,"Exit")
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL)
    
    
menu_display(idMenu0)
    
    return 
PLUGIN_HANDLED
}

public 
test_show(idMenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
iData[6]
    new 
iAccess
    
new iCallback
    
new iName[64]
    
    
menu_item_getinfo(MenuitemiAccessiData5iName63iCallback)
    
    switch(
str_to_num(iData))
    {
        case 
1:
        {
            
client_cmd(id"say test-hi-123");
            
TestConnectMenu(id)
        }

    }
    return 
PLUGIN_HANDLED

AppStore is offline
Reply



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:12.


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