Raised This Month: $ Target: $400
 0% 

Hud message show


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asd13
Member
Join Date: Apr 2009
Old 10-26-2009 , 07:09   Hud message show
Reply With Quote #1

Why isnt this code working?
Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

public plugin_init() {
    register_plugin("Plugin", "Beta", "1932")

    new szMap[ 11 ];
    get_mapname( szMap, 10 );
    
    if( equali( szMap, "de_dust2" ) ) {
    server_cmd("changelevel surf_green")
    server_exec()
    }
    if( equali( szMap, "surf_green" ) ) {
    set_task(120.0, "show_rules", 54564, _, _, "b")
    }
}

public show_rules(id)
{
    set_hudmessage(255, 0, 0, 0.05, 0.2, 0, 6.0, 12.0)
    show_hudmessage(id, "Surf Green Reeglid!")
    set_hudmessage(255, 0, 0, 0.05, 0.2, 0, 6.0, 12.0)
    show_hudmessage(id, "Keelatud on killida:")
    set_hudmessage(255, 0, 0, 0.05, 0.2, 0, 6.0, 12.0)
    show_hudmessage(id, "1. Relvaka ees!")
    set_hudmessage(255, 0, 0, 0.05, 0.2, 0, 6.0, 12.0)
    show_hudmessage(id, "2. Relvaka sees!")
    set_hudmessage(255, 0, 0, 0.05, 0.2, 0, 6.0, 12.0)
    show_hudmessage(id, "3. Topis!")
    set_hudmessage(255, 0, 0, 0.05, 0.2, 0, 6.0, 12.0)
    show_hudmessage(id, "Reeglite eirajaid karistatakse!")
}
The point is to show those messages if map is surf green and if map is de_dust2 it changes 2 surf_green

Last edited by asd13; 10-26-2009 at 10:06.
asd13 is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 10-26-2009 , 21:56   Re: Hud message show
Reply With Quote #2

What does it do? Do you also understand that you're telling it to display the rules 120 seconds after the map is changed? I suggest you do it each time a client is put in the server and only to that client. And since you keep sending HUD Messages to the same channel, i suggest you do something like this:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

public plugin_init() {
    
register_plugin("Plugin""Beta""1932")

    new 
szMap11 ];
    
get_mapnameszMap10 );
    
    if( 
equaliszMap"de_dust2" ) ) {
    
server_cmd("changelevel surf_green")
    
server_exec()
    }
    if( 
equaliszMap"surf_green" ) ) {
    
set_task(120.0"show_rules"54564__"b")
    }
}

public 
show_rules()
{
    
set_hudmessage(255000.050.206.012.0)
    
show_hudmessage(0"Surf Green Reeglid!^nKeelatud on killida:^n1. Relvaka ees!^n2. Relvaka sees!^n3. Topis!^nReeglite eirajaid karistatakse!")

__________________

Last edited by johnjg75; 10-26-2009 at 22:01.
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
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 07:55.


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