Raised This Month: $ Target: $400
 0% 

Scripting Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 10-04-2014 , 08:04   Scripting Question
Reply With Quote #1

How to make so that the one who type a command ie: /hello only see the output results ie; /hello command ie: a chat message will be appear to him "WELCOME TO SERVER" but i want that if player type /hello then he should see the output but other see "Server is welcoming %s" but d one who type /hello should only see "WELCOME TO SERVER"

Last edited by Awesome_man; 10-04-2014 at 08:04.
Awesome_man is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 10-04-2014 , 09:45   Re: Scripting Question
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin( "Welcoming Chat", "0.0.1", "Baws" );         register_clcmd( "say /hello", "WelcomeChat" ); } public WelcomeChat(id) {     client_print( id, print_chat, "Welcome to the server!" );         new szName[ 32 ];     get_user_name( id, szName, charsmax( szName ) )     client_print( 0, print_chat, "The server is welcoming %s!", szName ) }
__________________
Like my clean plugins and work?
Baws is offline
Awesome_man
Senior Member
Join Date: May 2014
Location: singapore
Old 10-04-2014 , 11:17   Re: Scripting Question
Reply With Quote #3

Quote:
Originally Posted by Baws View Post
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() { &nbsp;&nbsp;&nbsp;&nbsp;register_plugin( "Welcoming Chat", "0.0.1", "Baws" ); &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;register_clcmd( "say /hello", "WelcomeChat" ); } public WelcomeChat(id) { &nbsp;&nbsp;&nbsp;&nbsp;client_print( id, print_chat, "Welcome to the server!" ); &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;new szName[ 32 ]; &nbsp;&nbsp;&nbsp;&nbsp;get_user_name( id, szName, charsmax( szName ) ) &nbsp;&nbsp;&nbsp;&nbsp;client_print( 0, print_chat, "The server is welcoming %s!", szName ) }
So, The one who typed /hello will only see "WELCOME TO SERVER" And not "The server is welcoming %s"

Right ?
Awesome_man is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-04-2014 , 10:11   Re: Scripting Question
Reply With Quote #4

If you want to print the message as hud message. ;)
PHP Code:
#include <amxmodx> 
#include <amxmisc> 

public plugin_init() 
{     
    
register_plugin"Welcoming Chat""0.0.1""Baws" );         
    
register_clcmd"say /hello""WelcomeChat" ); 


public 
WelcomeChat(id
{     
    
set_hudmessage(025500.010.2806.01.10.00.0, -1);
    
show_hudmessage(id"Welcome to the server!" );
    
    new 
szName32 ];     
    
get_user_nameidszNamecharsmaxszName ) ) 
    
set_hudmessage(025500.010.2806.01.10.00.0, -1);
    
show_hudmessage(0"The server is welcoming %s!"szName);    

zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-04-2014 , 11:17   Re: Scripting Question
Reply With Quote #5

Yes
__________________
HamletEagle is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 10-04-2014 , 12:59   Re: Scripting Question
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
Yes
no
why are people suggesting this crap, the player joining will see both messages

PHP Code:
new iPlayers[32]
            new 
iNum
            
new player
            get_players
iPlayersiNum )
new 
szName32 ]; 
    
get_user_nameidszNamecharsmaxszName ) )
            for( new 
0iNumi++ )
            {
                
player iPlayers[i]
                if(
player==id)
                        
client_printidprint_chat"Welcome to the server!" );

                else
client_printplayerprint_chat"The server is welcoming %s!"szName )             } 
holy shit that's some horrible indentation
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.

Last edited by aron9forever; 10-04-2014 at 13:14. Reason: don't want the welcoming message 31 times on a full server
aron9forever is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 10-04-2014 , 16:14   Re: Scripting Question
Reply With Quote #7

Quote:
Originally Posted by aron9forever View Post
no
why are people suggesting this crap, the player joining will see both messages

PHP Code:
new iPlayers[32]
            new 
iNum
            
new player
            get_players
iPlayersiNum )
new 
szName32 ]; 
    
get_user_nameidszNamecharsmaxszName ) )
            for( new 
0iNumi++ )
            {
                
player iPlayers[i]
                if(
player==id)
                        
client_printidprint_chat"Welcome to the server!" );

                else
client_printplayerprint_chat"The server is welcoming %s!"szName )             } 
holy shit that's some horrible indentation
lol nice one
__________________
Like my clean plugins and work?
Baws is offline
Kuma77
Senior Member
Join Date: Sep 2014
Location: Behind PC
Old 10-04-2014 , 17:11   Re: Scripting Question
Reply With Quote #8

this Issue already sloved !! right Awesome_man
__________________
SPACE TIME

Last edited by Kuma77; 10-04-2014 at 17:12. Reason: nothing matter
Kuma77 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-04-2014 , 13:08   Re: Scripting Question
Reply With Quote #9

@aron9forever, lol, you are right. I didn't pay attention on it.
__________________
HamletEagle 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 17:41.


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