AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Scripting Question (https://forums.alliedmods.net/showthread.php?t=249336)

Awesome_man 10-04-2014 08:04

Scripting Question
 
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"

Baws 10-04-2014 09:45

Re: Scripting Question
 
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 ) }

zmd94 10-04-2014 10:11

Re: Scripting Question
 
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);    



Awesome_man 10-04-2014 11:17

Re: Scripting Question
 
Quote:

Originally Posted by Baws (Post 2206949)
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 ?

HamletEagle 10-04-2014 11:17

Re: Scripting Question
 
Yes

aron9forever 10-04-2014 12:59

Re: Scripting Question
 
Quote:

Originally Posted by HamletEagle (Post 2206991)
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

HamletEagle 10-04-2014 13:08

Re: Scripting Question
 
@aron9forever, lol, you are right. I didn't pay attention on it.

Baws 10-04-2014 16:14

Re: Scripting Question
 
Quote:

Originally Posted by aron9forever (Post 2207040)
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 :3

Kuma77 10-04-2014 17:11

Re: Scripting Question
 
this Issue already sloved !! right Awesome_man


All times are GMT -4. The time now is 17:41.

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