Raised This Month: $ Target: $400
 0% 

Open: Multilingual Menu | Solved: Rendering, Set_Task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-13-2008 , 12:41   Open: Multilingual Menu | Solved: Rendering, Set_Task
Reply With Quote #1

Hello!

I'm a beginner in PAWN, but i try to realize my third plugin.
I have some questions. I'm hopeing that someone help me:

1. Menu's
How can i be able to connect multilateral functions together on the right way? I use the following code, but whatever it works only by site 1.
On all other sites doesnt works.
PHP Code:
new mDPFunmenu2 // Menu
new mcbDPFunmenu2 // Menu Callback

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

        
mDPFunmenu menu_create("Menuname""mh_DPFunmenu")
        
mcbDPFunmenu menu_makecallback("mcb_DPFunmenu")
    
menu_additem(mDPFunmenu"Do That""do_that",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That2""do_that2",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That3""do_that3",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That3""do_that3",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That4""do_that4",ADMIN_ALLmcbDPFunmenu)
        .
        .
        .
    
menu_additem(mDPFunmenu"Do ThatN""do_thatn",ADMIN_ALLmcbDPFunmenu)
    
register_clcmd("say /test","show_menu",0,"- Shows up the DP-Funmenu")
}

public 
show_dpmenu(id) {
    
menu_display(idmDPFunmenu0)
}

public 
mh_DPFunmenu(idmenuitem) {
    switch (
item) {
         case 
0: { 
        
do_that(id);  
          }
     case 
1: { 
         
do_that2(id);
     }
     case 
2: { 
        
do_that3(id);
     }
     case 
3: { 
        
do_that4(id);
     }
     case 
4: { 
         
do_that5(id);
     }
         .
         .
         .
         case 
{
                
do_thatn(id);
         }

       }


2. Rendering [SOLVED]
How is it possible to let a player be invisible?


3. Set_Task [SOLVED]
I want to send a massage all 120 seconds as a ´Hud massage´ to all players- what shell i do, that it works? I used following code:

Thanks in advance!
- Grinf4ce
__________________

Last edited by Grinf4ce; 06-14-2008 at 06:31. Reason: Updating²...
Grinf4ce is offline
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 06-13-2008 , 18:52   Re: 3 Questions: Menu, Rendering & set_task
Reply With Quote #2

2.) Call this on every spawn and weapon change.

Code:
new InvisibleLevel = 0; set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, InvisibleLevel );

3.)

Code:
public plugin_init() {         set_task(120.0,"advert") } public advert() {     set_hudmessage(255, 0, 0, -1.0, 0.90, 0, 6.0, 20)     show_hudmessage(0, "Test") }
__________________
DA is offline
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-14-2008 , 02:12   Re: 3 Questions: Menu, Rendering & set_task
Reply With Quote #3

Hi DA!
Thanks for your help.

3.) Works well
2.) How i can call it on weapon change?
__________________
Grinf4ce is offline
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 06-14-2008 , 04:16   Re: 3 Questions: Menu, Rendering & set_task
Reply With Quote #4

Code:
register_event ( "CurWeapon", "CheckInvisible", "be", "1=1" ); // This is called on every weaponchange public CheckInvisible( id ) {     // For secure we check if the player is alive     if ( !is_user_alive ( id ) )     {         return PLUGIN_CONTINUE;     }     // Set the invisibility     new InvisibleLevel = 0;     set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, InvisibleLevel );         return PLUGIN_CONTINUE; }
__________________
DA is offline
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-14-2008 , 06:37   Re: 3 Questions: Menu, Rendering & set_task
Reply With Quote #5

Thank you very much!

I have a other question to set_task:

I want to make a player glow for 3 seconds, useing the following code:
PHP Code:
public glow(id,r,g,b) {
 
set_user_rendering(id,kRenderFxGlowShell,r,g,b,kRenderNormal,25)
}

public 
unglow(id) {
 
set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
}

public 
anyfunction(id) {
 
glow(id,255,0,0)
 
set_task(3.0,"unglow")

Can you help me please?

- Grinf4ce
__________________
Grinf4ce is offline
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 06-14-2008 , 19:28   Re: 3 Questions: Menu, Rendering & set_task
Reply With Quote #6

Try this:

Code:
public unglow(id) {  set_user_rendering( id ); }
__________________
DA is offline
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-16-2008 , 10:28   Re: 3 Questions: Menu, Rendering & set_task
Reply With Quote #7

Thank you very much, DA! +Karma 4 you.

My last question:
How i can create Multilingual Menus?
I dont know where to put the %L and varname :-S

PHP Code:
new mDPFunmenu
new mcbDPFunmenu

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

        
mDPFunmenu menu_create("Menuname""mh_DPFunmenu")
        
mcbDPFunmenu menu_makecallback("mcb_DPFunmenu")
    
menu_additem(mDPFunmenu"Do That""do_that",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That2""do_that2",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That3""do_that3",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That3""do_that3",ADMIN_ALLmcbDPFunmenu)
    
menu_additem(mDPFunmenu"Do That4""do_that4",ADMIN_ALLmcbDPFunmenu)
        
register_clcmd("say /test","show_menu",0,"- Shows up the DP-Funmenu")
}

public 
show_dpmenu(id) {
    
menu_display(idmDPFunmenu0)
}

public 
mh_DPFunmenu(idmenuitem) {
    switch (
item) {
  case 
0: { do_that(id); }
     case 
1: { do_that2(id); }
     case 
2: { do_that3(id); }
     case 
3: { do_that4(id); }
     case 
4: { do_that5(id); }
        }


Thanks in advance,
-Grinf4ce
__________________

Last edited by Grinf4ce; 06-16-2008 at 10:35. Reason: Updating Source
Grinf4ce is offline
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 06-16-2008 , 12:22   Re: Multilingual Menu | Solved: Rendering, Set_Task
Reply With Quote #8

hmm. I can't help you with this example because I use the old menusystem. Here is an example...

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "DA" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         // Register the menu     register_menu ( "MyMenuName", 1023, "CheckSelectedKey" );         // That call the function ShowMenu     register_clcmd( "say showmenu", "ShowMenu", -1 ); } public ShowMenu( id ) {     if ( !is_user_connected( id ) )     {         return PLUGIN_CONTINUE;     }         // We take a var where we save the menuoptions     static MenuMessage[64];         // Here we create the header     copy ( MenuMessage, charsmax( MenuMessage ), "\yHead from the Menu\w^n^n" );         // We add a menupoint     formatex ( MenuMessage, charsmax( MenuMessage ), "%s1. Jap...^n", MenuMessage );         // We add another menupoint     formatex ( MenuMessage, charsmax( MenuMessage ), "%s2. Ähh...^n", MenuMessage );         // We add an exit point     formatex ( MenuMessage, charsmax( MenuMessage ), "%s^n0. Exit^n", MenuMessage );         // We need two keys     new keys = (1<<0) | (1<<1) | (1<<9);         // Okay. Show the player the menu     show_menu ( id, keys, MenuMessage, 15, "MyMenuName" );         return PLUGIN_CONTINUE; } public CheckSelectedKey( id, key ) {     if ( !is_user_connected( id ) )     {         return PLUGIN_CONTINUE;     }         // We have to add one because the menupoints are from 0 - 9     key++;         switch ( key )     {         case 1:         {             client_print( id, print_chat, "You have selected Menupoint one" );         }                 case 2:         {             client_print( id, print_chat, "You have selected Menupoint two" );         }                 case 10: // Exit key         {             return PLUGIN_CONTINUE;         }     }         return PLUGIN_CONTINUE; }
__________________
DA is offline
Grinf4ce
Senior Member
Join Date: May 2006
Old 06-17-2008 , 00:45   Re: Multilingual Menu | Solved: Rendering, Set_Task
Reply With Quote #9

Hi!
Sounds very logical the old menusystem.. the new is complicated for me

But what do following line:
PHP Code:
new keys = (1<<0) | (1<<1) | (1<<9); 
And what means the numbers in the following lines?
PHP Code:
show_menu idkeysMenuMessage15"MyMenuName" ); 
and
PHP Code:
register_menu "MyMenuName"1023"CheckSelectedKey" ); 
The functionslist says "keys", but which keys and how?

Sorry for my annoying
- Grinf4ce
__________________
Grinf4ce is offline
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 06-17-2008 , 04:59   Re: Multilingual Menu | Solved: Rendering, Set_Task
Reply With Quote #10

Quote:
Originally Posted by Grinf4ce View Post
But what do following line:
PHP Code:
new keys = (1<<0) | (1<<1) | (1<<9); 
These are the keys. (1<<0) is the bitcode for the button "1". (1<<1) is the bitcode for button two. You can add bitcodes with the "|" operator.

Quote:
Originally Posted by Grinf4ce
And what means the numbers in the following lines?
PHP Code:
show_menu idkeysMenuMessage15"MyMenuName" ); 
and
PHP Code:
register_menu "MyMenuName"1023"CheckSelectedKey" ); 
id - The id from the player
keys - The available keys which the player can press
MenuMessage - This is the menu which will be displayed
15 - After 15 seconds the menu will automaticle close
"MyMenuName" - This is the pointer to the registered menu
1023 - All available keys
"CheckSelectedKey" - If the player press a right key, the plugin will call this function
__________________
DA 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 06:01.


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