Raised This Month: $ Target: $400
 0% 

Solved [Help] Wrong Value Printed !!!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Begineer Programmer
Member
Join Date: Nov 2021
Old 08-31-2022 , 02:59   Re: [Help] Wrong Value Printed !!!
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
Do NOT use PLUGIN_CONTINUE because it makes no sense in the context. You should simply return a 0.
Thanks and Updated !!!

PHP Code:
#include <amxmodx> 
#include <cstrike>
#include <amxmisc>
#pragma semicolon 1
#pragma tabsize 4
new runde 0;
new 
prefix[32] = "AMXX";
new 
TerrScoreCTScore;
public 
plugin_init()  

    
register_plugin"Info Top""1.4""->UrOS<-");    
    
register_event("HLTV""round_start""a""1=0""2=0");
    
register_event("TextMsg""round_restart""a""2=#Game_will_restart_in""2=#Game_Commencing");
    
register_event("TeamScore""terr_score""a""1=TERRORIST");
    
register_event("TeamScore""ct_score""a""1=CT");

public 
round_restart()
{
    
runde 0;
    
TerrScore=0;
    
CTScore=0;
}
public 
terr_score()
{
    
TerrScore read_data(2);
}
public 
ct_score()
{
    
CTScore read_data(2);
}
public 
round_start() 

    
    
    new 
mapname[32], nextmap[32], players[32], player ,maxrundimaxplayers,maxroundsCvar;
    
    
maxrundi=get_cvar_num("mp_maxrounds");
    
maxplayers=get_maxplayers();
    
get_cvar_string("amx_nextmap",nextmap,31); 
    
get_mapname(mapname,31);
    
get_players(playersplayer);
    
maxroundsCvar=get_map_maxrounds(mapname);
    if (
maxroundsCvar==0)
    {
        
client_print_color(0,print_team_default,"^4[%s]^3 Rounds:^4 %d^3/^4%d ^1|^3 Score:^3 Ts:^4%i^3 -^3 CTs:^4%i ^1|^3 Map:^4 %s^3/^4%s ^1[^4No Round Limit^1] ^1|^3 Players:^4 %d^3/^4%d",prefixrunde,maxrundi,TerrScore,CTScore,mapnamenextmapplayer,maxplayers);
    }
    else
    {
        
client_print_color(0,print_team_default,"^4[%s]^3 Rounds:^4 %d^3/^4%d ^1|^3 Score:^3 Ts:^4%i^3 -^3 CTs:^4%i ^1|^3 Map:^4 %s^3/^4%s ^1[^4%i^1] ^1|^3 Players:^4 %d^3/^4%d",prefixrunde,maxrundi,TerrScore,CTScore,mapnamenextmap,maxroundsCvarplayer,maxplayers);
    }
     
    
runde++;
}
get_map_maxrounds(szMapname[])
{
    new 
szConfigsDir[64], szFilePath[128];
    
get_configsdir(szConfigsDircharsmax(szConfigsDir));
    
format(szFilePathcharsmax(szFilePath), "%s/maps/%s.cfg",szConfigsDirszMapname);
    new 
fopen(szFilePath"rt");
    if( 
)
    {
        new 
szCvar[32], szValue[32], szCfgData[64],iValue;
    
        while(
fgets(fszCfgDatacharsmax(szCfgData)))
        {
            
parse(szCfgDataszCvarcharsmax(szCvar), szValuecharsmax(szValue));
        
            if(
equali(szCvar"mp_maxrounds"))
            {
                
iValue str_to_num(szValue);    
            }
            
        }
        
fclose(f);
        return 
iValue;
    }
    return 
0;

Begineer Programmer is offline
 



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 15:33.


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