Raised This Month: $51 Target: $400
 12% 

Small problem with menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Watt
Senior Member
Join Date: Jan 2008
Location: Poland :D
Old 02-25-2008 , 08:49   Small problem with menu
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#define CT CsTeams:CS_TEAM_CT
#define T CsTeams:CS_TEAM_T

new const key[] = "v"
new const command[] = "pgc"

public plugin_init()
{
  
register_plugin("MENU""0.5""sb");
  
register_clcmd("say /pgc""buymenu");
  
register_clcmd("say_team /pgc""buymenu"); //nie jestem pewien co do tych dwoch
  
register_clcmd("pgc""buymenu") ;
  
register_dictionary ("pgc_surfmenu.txt")
}


public 
buymenu(id)
{

    
    if(
is_user_alive(id))
    {
        new 
formatstr[32];
        if(
cs_get_user_team(id) == CT || cs_get_user_team(id) == T)
        {
            
            new 
menu menu_create("PGC Surf Menu""handle_buymenu");
            
formatex(formatstr31"%L"id"CP")
            
menu_additem(menuformatstr"1");
            
formatex(formatstr31"%L"id"TP")
            
menu_additem(menuformatstr"1");
            
formatex(formatstr31"%L"id"RESPAWN")
            
menu_additem(menuformatstr"1");
            
formatex(formatstr31"%L"id"MAPY")
            
menu_additem(menuformatstr"1");
            
formatex(formatstr31"%L"id"IP")
            
menu_additem(menuformatstr"1");
            
menu_display(idmenu0);
        }
        else
        {
            
client_print(idprint_chat,"%L",id,  "BRAK_DOSTEPU");
        }
    }
    else
    {
        
client_print(idprint_chat,"%L",id"NIE_ZYWY");
    }
    return 
PLUGIN_CONTINUE
}
public 
handle_buymenu(idmenuitem)
{
  if(
item == MENU_EXIT)
  {
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
  }
  if(
cs_get_user_team(id) == CT)
  {
    switch(
item)
    {
      case 
0:
      {
      
client_cmd(id"say /cp");
       
      }
      
       case 
1:
      {
      
    
client_cmd(id"say /tp");
    
     }
      case 
2:
      {
      
    
client_cmd(id"respawn_pgc");
     }
     case 
3:
      {
      
    
client_cmd(id"say /mapy");
     }
     case 
4:
      {
      
    
client_cmd(id"amx_ip *");
    
client_print(idprint_chat,"%L",id"KONSOLA");
     }

     
     
        }
      }
  
  
  if(
cs_get_user_team(id) == T)
      {
    switch(
item)
    {
      case 
0:
      {
      
client_cmd(id"say /cp");
       
      }
      
       case 
1:
      {
      
    
client_cmd(id"say /tp");
    
     }
      case 
2:
      {
      
    
client_cmd(id"respawn_pgc");
     }
     case 
3:
      {
      
    
client_cmd(id"say /mapy");
     }
     case 
4:
      {
      
    
client_cmd(id"amx_ip *");
    
client_print(idprint_chat,"%L",id"KONSOLA");
     }

      
    }
  }
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
}

public 
client_connect(id)
{   
    new 
full_command[32];
   
    
formatex(full_commandsizeof full_command 1"bind %s ^"%s^""keycommand);
    
client_cmd(idfull_command);

Hello I have got a problem how to make that menu will show when you entry server. And when you click my menu it destroy how to make that after click it will stay. ?
Watt is offline
 



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 03:47.


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