Raised This Month: $ Target: $400
 0% 

how can i get input like hud message?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mi1s0n
Junior Member
Join Date: Jun 2012
Old 07-06-2012 , 14:54   how can i get input like hud message?
Reply With Quote #1

hi guys
Im a beginner in amxmodx scripting can u help me with this 3 questions?
1 - how can I get user input like username and password in a manner like hud message at the left of the screen?
I think I have to detect user's pressed keys and print them on screen while ENTER key has not been pressed
2 - how can I get the winner team after round ends?is there any functions?
3 - how can I show a hud message when a user connects?

sorry if my questions are stupid,i have searched a lot but found nothing help please

Last edited by mi1s0n; 07-06-2012 at 15:08.
mi1s0n is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-06-2012 , 16:17   Re: how can i get input like hud message?
Reply With Quote #2

Quote:
Originally Posted by mi1s0n View Post
3 - how can I show a hud message when a user connects?
In the amxmodx.inc you will find client_putinserver() which is called when the player joins the game, declare it as a public function, then use the natives set_hudmessage() and show_hudmessage() to set and show the hud colors with the wanted colors\positions.
That's all.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
mi1s0n
Junior Member
Join Date: Jun 2012
Old 07-06-2012 , 16:45   Re: how can i get input like hud message?
Reply With Quote #3

I've test this but its not working
can u tell me whats wrong pokemonmaster?
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "mi1s0n"
#define VERSION "1.0"
#define AUTHOR "Milad Doorbash"



public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)    
}
public client_putinserver(id)
{
    set_hudmessage(255, 255, 42, 0.02, 0.47, 0, 6.0, 12.0)
    show_hudmessage(id, "your id is  : %d",id)
}

Last edited by mi1s0n; 07-06-2012 at 16:47.
mi1s0n is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-06-2012 , 16:53   Re: how can i get input like hud message?
Reply With Quote #4

you will have to set a timer, you are not "in" the server and able to read the HUD message
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
mi1s0n
Junior Member
Join Date: Jun 2012
Old 07-06-2012 , 17:21   Re: how can i get input like hud message?
Reply With Quote #5

YamiKaitou do you mean something like this?
this is good but has a problem : shows message to everyone!! again and again
i used "a" flag with repeat = 1 but no messages appeared on scrren

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "mi1s0n"
#define VERSION "1.0"
#define AUTHOR "Milad Doorbash"



public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    set_task( 3, "myfunction", 0, "", 0,"b")
    
}
public myfunction(){
    new id
    for(id = 1; id <= get_maxplayers(); id++)
    {
        if(is_user_connected(id))
        {
            set_hudmessage(255, 255, 42, 0.25, 0.22, 0, 6.0, 12.0)
            show_hudmessage(id, "HIIIIIII HOW ARE U???")
            
        }
        
    }
}
anyone has an idea about my first and 2nd questions?

Last edited by mi1s0n; 07-06-2012 at 17:26.
mi1s0n is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-06-2012 , 17:25   Re: how can i get input like hud message?
Reply With Quote #6

Quote:
Originally Posted by mi1s0n View Post
1 - how can I get user input like username and password in a manner like hud message at the left of the screen?
Use messagemode to take user input or a console command

Quote:
I think I have to detect user's pressed keys and print them on screen while ENTER key has not been pressed
Not possible

Quote:
2 - how can I get the winner team after round ends?is there any functions?
Search

Quote:
3 - how can I show a hud message when a user connects?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "mi1s0n"
#define VERSION "1.0"
#define AUTHOR "Milad Doorbash"



public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)    
}

public 
client_putinserver(id)
{
    
set_task(10.0"showHud"id)
}

public 
showHud(id)
{
    
set_hudmessage(255255420.020.4706.012.0)
    
show_hudmessage(id"your id is  : %d",id)

__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
mi1s0n
Junior Member
Join Date: Jun 2012
Old 07-06-2012 , 17:38   Re: how can i get input like hud message?
Reply With Quote #7

thanx a lot YamiKaitou

Last edited by mi1s0n; 07-06-2012 at 17:38.
mi1s0n is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-06-2012 , 17:42   Re: how can i get input like hud message?
Reply With Quote #8

Quote:
Originally Posted by YamiKaitou View Post
Not possible
Yes it is?

Last edited by Santaaa; 07-06-2012 at 17:42.
Santaaa is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-06-2012 , 17:43   Re: how can i get input like hud message?
Reply With Quote #9

Quote:
Originally Posted by Santaaa View Post
Yes it is?
No it is not. You can only detect certain actions, but not specific keys.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-06-2012 , 17:46   Re: how can i get input like hud message?
Reply With Quote #10

Yeah, he asked if it is possible to check for the winning team, yes you can. But there isnt a spececfic function for that.
Santaaa 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 20:46.


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