Raised This Month: $51 Target: $400
 12% 

Run Statistics


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
myusername
Senior Member
Join Date: Aug 2012
Old 01-05-2014 , 10:11   Run Statistics
Reply With Quote #1

Hi, i need run statistics like in this zombie escape mode. I want to use it in Deathrun server. I've tried to get some code from zombie escape but not working.

Help me.

Here is what ive got so far...
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define OFFICIAL_LANG LANG_PLAYER

enum
{
    
RANK_NONE 0,
    
RANK_FIRST,
    
RANK_SECOND,
    
RANK_THIRD
}

enum
{
    
TEAM_T 1,
    
TEAM_CT 2
}

new 
g_WinText[7][64]
new 
Float:delay_hud[33]
new 
g_escape_point[33]
new 
g_MaxPlayersscore_hudstat_hud
new g_escape_rank[4]
new 
g_team_score[6]

public 
plugin_init()
{    
    
register_dictionary("zombie_escape.txt")
    
RegisterHam(Ham_Spawn"player""fw_Spawn_Post"1)
    
    
g_MaxPlayers get_maxplayers()    
    
    
format(g_WinText[TEAM_T], 63"Escape Fail")
    
format(g_WinText[TEAM_CT], 63"Escape Success")        
    
    
score_hud CreateHudSyncObj(2)
}

public 
client_putinserver(id)
{
    
g_escape_point[id] = 0
}

public 
get_stat()
{
    static 
highestcurrent
    highest 
current 0
    
    
// Rank First
    
for(new 0g_MaxPlayersi++)
    {
        if(!
is_user_connected(i))
            continue
        if(!
is_user_alive(i))
            continue
        if(
cs_get_user_team(i) == CS_TEAM_T)
            continue
            
        if(
g_escape_point[i] > highest)
        {
            
current i
            highest 
g_escape_point[i]
        }
    }
    
g_escape_rank[RANK_FIRST] = current
    
    
// Rank Second
    
highest current 0    
    
for(new 0g_MaxPlayersi++)
    {
        if(!
is_user_connected(i))
            continue
        if(!
is_user_alive(i))
            continue
        if(
cs_get_user_team(i) == CS_TEAM_T)
            continue            
        if(
g_escape_rank[RANK_FIRST] == i)
            continue
            
        if(
g_escape_point[i] > highest)
        {
            
current i
            highest 
g_escape_point[i]
        }
    }
    
g_escape_rank[RANK_SECOND] = current        
    
    
// Rank Third
    
highest current 0    
    
for(new 0g_MaxPlayersi++)
    {
        if(!
is_user_connected(i))
            continue
        if(!
is_user_alive(i))
            continue
        if(
cs_get_user_team(i) == CS_TEAM_T)
            continue            
        if(
g_escape_rank[RANK_FIRST] == || g_escape_rank[RANK_SECOND] == i)
            continue
            
        if(
g_escape_point[i] > highest)
        {
            
current i
            highest 
g_escape_point[i]
        }
    }
    
g_escape_rank[RANK_THIRD] = current    
}

public 
client_PostThink(id)
{
    if(!
is_user_connected(id))
        return
    if(
get_gametime() - 1.0 delay_hud[id])
    {
        
// Show Score
        
set_hudmessage(255255255, -1.00.002.02.0)
        
ShowSyncHudMsg(idscore_hud"%L"OFFICIAL_LANG"HUD_SCORE"g_team_score[TEAM_T], g_team_score[TEAM_CT])
        
        
// Add Point for Who is Running Fast
        
if(cs_get_user_team(id) == CS_TEAM_CT)
        {
            static 
Float:Velocity[3], Speed
            
            pev
(idpev_velocityVelocity)
            
Speed floatround(vector_length(Velocity))
            
            switch(
Speed)
            {
                case 
210..229g_escape_point[id] += 1
                
case 230..249g_escape_point[id] += 2
                
case 250..300g_escape_point[id] += 3
            
}
        }
        
        
// Show Stat
        
show_stat(id)
        
delay_hud[id] = get_gametime()
    }
}

public 
show_stat(id)
{
    
get_stat()
    new 
temp_string_first[64], temp_string_second[64], temp_string_third[64], curidPlayer_Name[64], none[32]
    
    
formatex(nonesizeof(none), "%L"OFFICIAL_LANG"RANK_NONE")
    
    
// Rank First
    
curid g_escape_rank[RANK_FIRST]
    if(
is_user_alive(curid) && cs_get_user_team(curid) == CS_TEAM_CT && g_escape_point[curid] != 0)
    {
        
get_user_name(curidPlayer_Namesizeof(Player_Name))
        
formatex(temp_string_firstsizeof(temp_string_first), "%L"OFFICIAL_LANG"RANK_FIRST"Player_Name)
    } else {
        
get_user_name(curidPlayer_Namesizeof(Player_Name))
        
formatex(temp_string_firstsizeof(temp_string_first), "%L"OFFICIAL_LANG"RANK_FIRST"none)    
    }
    
    
// Rank Second
    
curid g_escape_rank[RANK_SECOND]
    if(
is_user_alive(curid) && cs_get_user_team(curid) == CS_TEAM_CT && g_escape_point[curid] != 0)
    {
        
get_user_name(curidPlayer_Namesizeof(Player_Name))
        
formatex(temp_string_secondsizeof(temp_string_second), "%L"OFFICIAL_LANG"RANK_SECOND"Player_Name)
    } else {
        
get_user_name(curidPlayer_Namesizeof(Player_Name))
        
formatex(temp_string_secondsizeof(temp_string_second), "%L"OFFICIAL_LANG"RANK_SECOND"none)    
    }
    
    
// Rank Third
    
curid g_escape_rank[RANK_THIRD]
    if(
is_user_alive(curid) && cs_get_user_team(curid) == CS_TEAM_CT && g_escape_point[curid] != 0)
    {
        
get_user_name(curidPlayer_Namesizeof(Player_Name))
        
formatex(temp_string_thirdsizeof(temp_string_third), "%L"OFFICIAL_LANG"RANK_THIRD"Player_Name)
    } else {
        
get_user_name(curidPlayer_Namesizeof(Player_Name))
        
formatex(temp_string_thirdsizeof(temp_string_third), "%L"OFFICIAL_LANG"RANK_THIRD"none)    
    }    

    
set_hudmessage(025500.050.3002.02.0)
    
ShowSyncHudMsg(idstat_hud"%L^n%s^n%s^n%s"OFFICIAL_LANG"RANK_INFO"temp_string_firsttemp_string_secondtemp_string_third)    
}

public 
fw_Spawn_Post(id)
{
    if(!
is_user_connected(id))
        return 
HAM_IGNORED
    
    g_escape_point
[id] = 0
    
    
return HAM_HANDLED

Gives me this error
PHP Code:
L 01/05/2014 23:01:01HudSyncObject -1 is invalid
L 01
/05/2014 23:01:01: [AMXXDisplaying debug trace (plugin "Statistics.amxx")
L 01/05/2014 23:01:01: [AMXXRun time error 10native error (native "ShowSyncHudMsg")
L 01/05/2014 23:01:01: [AMXX]    [0RunStatistics.sma::show_stat (line 190)
L 01/05/2014 23:01:01: [AMXX]    [1RunStatistics.sma::client_PostThink (line 144
__________________
Rest in piece.

Last edited by myusername; 01-05-2014 at 10:15.
myusername is offline
myusername
Senior Member
Join Date: Aug 2012
Old 01-28-2014 , 08:51   Re: Run Statistics
Reply With Quote #2

Bring
Up
My
Post
__________________
Rest in piece.

Last edited by myusername; 01-28-2014 at 08:51.
myusername is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-28-2014 , 09:34   Re: Run Statistics
Reply With Quote #3

Duplicate post
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd 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 01:39.


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