Raised This Month: $ Target: $400
 0% 

Round Counter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ichiban
Member
Join Date: Dec 2008
Old 11-29-2010 , 21:19   Re: Round Counter
Reply With Quote #1

Thank you both.

I used both of your improvements.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Test"

new g_iPlayerRounds[33];
new 
g_iTotalRounds;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_logevent("Event_RoundStart"2"1=Round_Start");
    
register_clcmd("say /round","showRound");
}

public 
Event_RoundStart()
{
    
//Increase Rounds Played for All Players
    
for(new 1<= get_maxplayers(); i++)
    {
        if(
is_user_connected(i))
        {
            if (
cs_get_user_team(i) != CS_TEAM_SPECTATOR)
            {
                
g_iPlayerRounds[i]++;
            }
        }
    }
    
    
//Increase Total Rounds
    
g_iTotalRounds++;      
}

public 
showRound(id)
{
    
client_print(idprint_chat"You have played %i/%i rounds"g_iPlayerRounds[id], g_iTotalRounds);

ichiban is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 11-29-2010 , 21:35   Re: Round Counter
Reply With Quote #2

Make sure you reset the index when the client disconnect and/or connects to/from the server.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 11:18.


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