Raised This Month: $ Target: $400
 0% 

Help mode CT Rounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
addons47
New Member
Join Date: Jun 2012
Old 06-14-2012 , 04:36   Help mode CT Rounds
Reply With Quote #1

Hello everyone,

I have CT Mod Rounds and I can not add /round name Small Description: cute examines several rounds City resides.

Code:
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
 
 
new CTRounds[ 33 ];
 
 
public plugin_init()
{
        register_plugin( "15 CT Rounds", "1.0", "ImNativus" );
       
        register_event( "SendAudio", "EventTeamWin", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2&%!MRAD_ROUNDDRAW" );
       
        RegisterHam( Ham_Spawn, "player", "FwdPlayerSpawn", 1 );
}
 
 
public FwdPlayerSpawn( client )
{
        if ( !is_user_connected( client ) || !is_user_alive( client ) )
                return;
       
        if ( cs_get_user_team( client ) == CS_TEAM_CT )
        {
                if ( CTRounds[ client ] + 1 <= 15 )
                {
                        client_print( client, print_chat, "Its your %d/15 Rounds at CT", CTRounds[ client ] + 1 );
                }
               
                else
                {
                        cs_set_user_team( client, CS_TEAM_T );
                       
                        ExecuteHamB( Ham_CS_RoundRespawn, client );
                }
        }
       
        else
        {
                CTRounds[ client ] = 0;
        }
}
 
 
public EventTeamWin( )
{
        for ( new i = 1; i <= get_maxplayers(); i++ )
        {
                if ( !is_user_connected( i ) || cs_get_user_team( i ) != CS_TEAM_CT )
                        continue;
               
                CTRounds[ i ]++;
        }
}

Last edited by addons47; 06-14-2012 at 04:36.
addons47 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-14-2012 , 08:25   Re: Help mode CT Rounds
Reply With Quote #2

Say what?

Are you trying to say that you want a say command - /round to show the number of rounds the CT side has won?

... get your request translated.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
addons47
New Member
Join Date: Jun 2012
Old 06-14-2012 , 08:35   Re: Help mode CT Rounds
Reply With Quote #3

/round name - I want it to show me a few rounds of CT in 15 limit.
addons47 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-14-2012 , 09:34   Re: Help mode CT Rounds
Reply With Quote #4

Do you mean like this?
Code:
//in plugin_init()     register_clcmd( "say /round", "Cmd_Round" ); // public Cmd_Round( id ) {     new szArg[ 32 ];     read_argv( 1, szArg, charsmax( szArg ) );         new iTarget = cmd_target( id, szArg, CMDTARGET_ALLOW_SELF );         if( iTarget )     {         get_user_name( iTarget, szArg, charsmax( szArg ) );         client_print( id, print_chat, "Player %s has played CT for %i / 15 rounds", szArg, CTRounds[ iTarget ] );     }     else     {         client_print( id, print_chat, "Player not found" );     } }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 06-14-2012 at 09:34.
hornet is offline
addons47
New Member
Join Date: Jun 2012
Old 06-14-2012 , 09:55   Re: Help mode CT Rounds
Reply With Quote #5

Yes, thank you.
addons47 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-14-2012 , 10:15   Re: Help mode CT Rounds
Reply With Quote #6

Quote:
Originally Posted by hornet View Post
Do you mean like this?
Code:
//in plugin_init()     register_clcmd( "say /round", "Cmd_Round" ); // public Cmd_Round( id ) {     new szArg[ 32 ];     read_argv( 1, szArg, charsmax( szArg ) );         new iTarget = cmd_target( id, szArg, CMDTARGET_ALLOW_SELF );         if( iTarget )     {         get_user_name( iTarget, szArg, charsmax( szArg ) );         client_print( id, print_chat, "Player %s has played CT for %i / 15 rounds", szArg, CTRounds[ iTarget ] );     }     else     {         client_print( id, print_chat, "Player not found" );     } }
That's not how you use say command arguments, therefore will not work.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-14-2012 , 19:35   Re: Help mode CT Rounds
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
That's not how you use say command arguments, therefore will not work.
Oops sorry, didn't think of that.


Use this instead:
Code:
// plugin_init()     register_clcmd( "say", "Cmd_Say" );     register_clcmd( "say_team", "Cmd_Say" );         // public Cmd_Say( id ) {     static szArgs[ 64 ], szArg[ 2 ][ 32 ];     read_args( szArgs, charsmax( szArgs ) );     remove_quotes( szArgs );         parse( szArgs, szArg[ 0 ], charsmax( szArg[] ), szArg[ 1 ], charsmax( szArg[] ) );         if( equal( szArg[ 0 ], "/round" ) )     {         new iTarget = cmd_target( id, szArg[ 1 ], CMDTARGET_ALLOW_SELF );             if( iTarget )         {             get_user_name( iTarget, szArg[ 1 ], charsmax( szArg[] ) );             client_print( id, print_chat, "Player %s has played CT for %i / 15 rounds", szArg[ 1 ], CTRounds[ iTarget ] );         }         else         {             client_print( id, print_chat, "Player not found" );         }                 return PLUGIN_HANDLED;     }         return PLUGIN_CONTINUE; }

Also don't forget to include amxmisc.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 06-14-2012 at 19:35.
hornet 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 06:17.


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