Raised This Month: $ Target: $400
 0% 

hud error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
omgitsme
Veteran Member
Join Date: Mar 2010
Old 06-17-2010 , 03:31   hud error
Reply With Quote #1

Code:
set_hudmessage("255", "255", "0", "-1.0", "-1.0", "0", "6.0", "5.0")
show_hudmessage(id, "Rasyk /pirkti jei nori vip/admin privelgu!")
#include <amxmodx>

 public plugin_init()
 {
 	register_plugin("Pirkti menu", "1.0", "omgitsme")
         register_clcmd( "say /pirkti","Pirkti");
 }
 public Pirkti(id)
 {
    new menu = menu_create("\rServer paslaugos:", "menu_handler");
    menu_additem(menu, "\wAdmin + Vip", "1", 0);
    menu_additem(menu, "\wAdmin", "2", 0);
    menu_additem(menu, "\wVip", "3", 0);
    menu_additem(menu, "\wSlot", "4", 0);
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id, menu, 0);
    
 }
 public menu_handler(id, menu, item)
 {
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
    new key = str_to_num(data);
    switch(key)
    {
        case 1:
        {
            show_motd(id, "admin.txt");
            menu_destroy(menu);
            return PLUGIN_HANDLED;
        }
        case 2:
        {
            show_motd(id, "uzas.txt");
        }
        case 3:
        {
            show_motd(id, "vip.txt");
        }
        case 4:
        {
            show_motd(id, "slot.txt");
        }
    }
    menu_destroy(menu);
    return PLUGIN_HANDLED;
 }
without hud it works, i made the hud with hud genorator. it's proberly not in the correct place or i did something wrong. can someone fix it please?
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
tm.
Member
Join Date: Apr 2010
Old 06-17-2010 , 04:14   Re: hud error
Reply With Quote #2

Remove the quotation marks:
Code:
set_hudmessage(255, 255, 0, -1.0, -1.0, 0, 6.0, 5.0)
And no way it's going to work setting the hud message before include. When exactly do you want the hud message to appear?

Last edited by tm.; 06-17-2010 at 04:17.
tm. is offline
omgitsme
Veteran Member
Join Date: Mar 2010
Old 06-17-2010 , 04:45   Re: hud error
Reply With Quote #3

ok, i removed them, and it now looks like this
Code:
#include <amxmodx>

set_hudmessage(255, 255, 0, -1.0, -1.0, 0, 6.0, 5.0)
show_hudmessage(id, "Rasyk /pirkti jei nori vip/admin privelgu!")

 public plugin_init()
 {
 	register_plugin("Pirkti menu", "1.0", "omgitsme")
         register_clcmd( "say /pirkti","Pirkti");
 }
is it correct now? what other modelus should i include? and i would like it to apear at the round start. my "first plugin that i want to update. sorry for stupid/noob questions. thanks
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-17-2010 , 04:51   Re: hud error
Reply With Quote #4

Quote:
Originally Posted by omgitsme View Post
ok, i removed them, and it now looks like this
Code:
#include <amxmodx>

set_hudmessage(255, 255, 0, -1.0, -1.0, 0, 6.0, 5.0)
show_hudmessage(id, "Rasyk /pirkti jei nori vip/admin privelgu!")

 public plugin_init()
 {
 	register_plugin("Pirkti menu", "1.0", "omgitsme")
         register_clcmd( "say /pirkti","Pirkti");
 }
is it correct now? what other modelus should i include? and i would like it to apear at the round start. my "first plugin that i want to update. sorry for stupid/noob questions. thanks
Yes thats correct, but if you want to be able to type "/pirkti" and have it display the hud message, use this:

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Pirkti menu""1.0""omgitsme")
    
register_clcmd"say /pirkti","Pirkti");
}

public 
Pirktiid )
{
    
set_hudmessage(2552550, -1.0, -1.006.05.0)
    
show_hudmessage(id"Rasyk /pirkti jei nori vip/admin privelgu!")

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
tm.
Member
Join Date: Apr 2010
Old 06-17-2010 , 05:07   Re: hud error
Reply With Quote #5

Actually it's not correct. Try this:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Pirkti menu""1.0""omgitsme")
    
register_logevent("roundstart"2"0=World triggered""1=Round_Start")
        
register_clcmd"say /pirkti","Pirkti");
}

public 
roundstart()
{
    
set_hudmessage(2552550, -1.0, -1.006.05.0)
    
show_hudmessage(0"Rasyk /pirkti jei nori vip/admin privelgu!")
}

public 
Pirkti(id)
{
    new 
menu menu_create("\rServer paslaugos:""menu_handler");
    
menu_additem(menu"\wAdmin + Vip""1"0);
    
menu_additem(menu"\wAdmin""2"0);
    
menu_additem(menu"\wVip""3"0);
    
menu_additem(menu"\wSlot""4"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
}

public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            
show_motd(id"admin.txt");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
2:
        {
            
show_motd(id"uzas.txt");
        }
        case 
3:
        {
            
show_motd(id"vip.txt");
        }
        case 
4:
        {
            
show_motd(id"slot.txt");
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

tm. is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-17-2010 , 06:34   Re: hud error
Reply With Quote #6

Quote:
Originally Posted by tm. View Post
Actually it's not correct. Try this:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Pirkti menu""1.0""omgitsme")
    
register_logevent("roundstart"2"0=World triggered""1=Round_Start")
        
register_clcmd"say /pirkti","Pirkti");
}

public 
roundstart()
{
    
set_hudmessage(2552550, -1.0, -1.006.05.0)
    
show_hudmessage(0"Rasyk /pirkti jei nori vip/admin privelgu!")
}

public 
Pirkti(id)
{
    new 
menu menu_create("\rServer paslaugos:""menu_handler");
    
menu_additem(menu"\wAdmin + Vip""1"0);
    
menu_additem(menu"\wAdmin""2"0);
    
menu_additem(menu"\wVip""3"0);
    
menu_additem(menu"\wSlot""4"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
}

public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            
show_motd(id"admin.txt");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
2:
        {
            
show_motd(id"uzas.txt");
        }
        case 
3:
        {
            
show_motd(id"vip.txt");
        }
        case 
4:
        {
            
show_motd(id"slot.txt");
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

I was actually referring to the third post in this topic.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
tm.
Member
Join Date: Apr 2010
Old 06-17-2010 , 08:14   Re: hud error
Reply With Quote #7

Quote:
Originally Posted by GXLZPGX View Post
I was actually referring to the third post in this topic.
Me too.
tm. is offline
omgitsme
Veteran Member
Join Date: Mar 2010
Old 06-17-2010 , 05:20   Re: hud error
Reply With Quote #8

no, i want /pirkti to make a menu. but i want a hud message every new round to say the message i typed^^
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
omgitsme
Veteran Member
Join Date: Mar 2010
Old 06-17-2010 , 12:24   Re: hud error
Reply With Quote #9

thanks, it works.
__________________
omgitsme is offline
Send a message via Skype™ to omgitsme
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 14:49.


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