Raised This Month: $ Target: $400
 0% 

get_user_name [shows server name] [help]


Post New Thread Reply   
 
Thread Tools Display Modes
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-07-2009 , 13:31   Re: get_user_name [shows server name] [help]
Reply With Quote #11

Quote:
Originally Posted by Arkshine View Post
I hope it's a joke xPaw.
Maybe.
__________________
xPaw is offline
mAr7obg
Senior Member
Join Date: May 2007
Location: Bulgaria
Old 10-08-2009 , 04:07   Re: get_user_name [shows server name] [help]
Reply With Quote #12

Quote:
Originally Posted by xPaw View Post
Not best..

PHP Code:
#include < amxmodx >
 
new const g_szSounds[ ][ ] = {
    
"server/stayinalive"
    
"server/force"
};
 
public 
plugin_init( ) {
    
register_plugin"""""" );
 
    
register_event"DeathMsg""EventDeath""a" );
}
 
public 
plugin_precache( )
    for( new 
isizeof g_szSoundsi++ )
        
precache_soundg_szSounds] );
 
public 
EventDeath( ) {
    
// This part is stupid but w/e...
    
new iPlayers][ 32 ], iNum];
    
get_playersiPlayers], iNum], "ae""CT" );
    
get_playersiPlayers], iNum], "ae""TERRORIST" );
 
    if( 
iNum] == && iNum] == ) {
        new 
szName][ 32 ];
        
get_user_nameiPlayers][ ], szName], 31 );
        
get_user_nameiPlayers][ ], szName], 31 );
 
        
set_hudmessagerandom256 ), random256 ), random256 ), -1.00.306.06.0 );
        
show_hudmessage0"%s vs %s !"szName], szName] );
    }
    else if( 
iNum] == ) {
        new 
szName32 ];
        
get_user_nameiPlayers][ ], szName31 );
 
        
set_hudmessagerandom256 ), random256 ), random256 ), -1.00.306.06.0 );
        
show_hudmessage0"%s (CT) is alone now :)"szName );
 
        
client_cmd0"spk %s"g_szSoundsrandomsizeof g_szSounds ) ] );
    }
    else if( 
iNum] == ) {
        new 
szName32 ];
        
get_user_nameiPlayers][ ], szName31 );
 
        
set_hudmessagerandom256 ), random256 ), random256 ), -1.00.306.06.0 );
        
show_hudmessage0"%s (T) is alone now :)"szName );
 
        
client_cmd0"spk %s"g_szSoundsrandomsizeof g_szSounds ) ] );
    }

Shows once more wrong
mAr7obg is offline
Send a message via Skype™ to mAr7obg
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-08-2009 , 07:40   Re: get_user_name [shows server name] [help]
Reply With Quote #13

Quote:
Originally Posted by mAr7obg View Post
then how to do it without DeathMsg
With Ham_Killed. Register the event with RegisterHam(Ham_Killed, "player", "Event_PlayerKilled").

Your function should have the following definition:

PHP Code:
public Event_PlayerKilled(idkillershouldgib)
{
    
// Code

Of course the name of the function is irrelevant here. Moreover, if you are to check both teams, you should use a loop from 1 to get_maxplayers(), like this:

PHP Code:
for (new 1<= get_maxplayers(); i++)
{
    if (
is_user_alive(i))
    {
        
// This player is alive, check his team with cs_get_user_team or so
    
}

vitorrd 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 22:33.


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