Raised This Month: $ Target: $400
 0% 

Solved [Help] Wrong Value Printed !!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-30-2022 , 11:06   Re: [Help] Wrong Value Printed !!!
Reply With Quote #1

PLUGIN_HANDLED is 1, you're returning it if the file couldn't be opened
jimaway is offline
Begineer Programmer
Member
Join Date: Nov 2021
Old 08-30-2022 , 11:24   Re: [Help] Wrong Value Printed !!!
Reply With Quote #2

Quote:
Originally Posted by jimaway View Post
PLUGIN_HANDLED is 1, you're returning it if the file couldn't be opened
I rename it as PLUGIN_CONTINUE !!!

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 [No Round Limit] ^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 [%i] ^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 
PLUGIN_CONTINUE;


Last edited by Begineer Programmer; 08-30-2022 at 11:39.
Begineer Programmer 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 15:33.


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