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

Solved Plugin not reading lines properly


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 11-16-2017 , 08:05   Plugin not reading lines properly
Reply With Quote #1

PHP Code:
public void OnMapStart()
{
    
checkmap();

PHP Code:
void checkmap()
{
    if(!
GetConVarBool(RespawnEnabled))
        return;

    
char line[128], g_szConfig[PLATFORM_MAX_PATH], g_szMap[128];
    
    
GetCurrentMap(g_szMapsizeof(g_szMap));
    
BuildPath(Path_SMg_szConfigsizeof(g_szConfig), "configs/ar_respawn_maps.cfg.cfg");
    
    
Handle MgMaps OpenFile(g_szConfig"r");
    
    while(!
IsEndOfFile(MgMaps))
    {
        
ReadFileLine(MgMapslinesizeof(line));
        
        if (
StrEqual(lineg_szMapfalse))
        { 
            
g_bEnableMap true;
            
LateForRespawn false;
        }
        
CloseHandle(MgMaps);
    } 
    else 
    {
        
PrintToServer("[SM] Could not find config (configs/ar_respawn_maps.cfg)");
    }

It only reads the last line of the config, so only the last map in the list, not all of them.

ar_respawn_maps.cfg.cfg:

Code:
mg_acrophobia_run_v1
mg_adev
mg_antique_course
mg_cartoon_course_v3_1
mg_course_ravine_final
mg_crash_bandicoot_course_v1
mg_cyber_course_v5
mg_damons_course_beta
mg_dans_course_remaster
mg_dev_galaxie_course_csgo
mg_dev_netrial_course
mg_dust_course_2_csgo_v1
mg_escape_castle_v3_fix
mg_gavle_course_v5
mg_lego_course_3_csgo
mg_metal_course_2
mg_metal_course_level
mg_metal_course_level_2
mg_minecraft_adventure_final_fix
mg_minecraft_course_JB_N1
mg_nimafa_3_final_v3
mg_nxr_course_csgo
mg_office_coursee_2012_fixed
mg_runordie_final
mg_savethebacon_course_final
mg_savetheisland_course_reskin
mg_saw_3_v1
mg_siberdev_2
mg_sky_realm_v3
mg_sonic_islands_v4
mg_switch_cource
mg_last_light_v3
mg_touchdev_course_fix
mg_tunnel_beta_cource
mg_office45_course
mg_pharaohs_tomb2_go_v3
mg_onetaprun_course_v2_d
mg_ancient_course_v2
mg_blood_sector_v1
mg_east_office_beta
mg_ghosts_cave_csgo
mg_halo_course_csgo
mg_heppy_dev_v1
mg_office_easy_course_csgo
__________________

Last edited by PinHeaDi; 11-16-2017 at 15:58.
PinHeaDi 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 17:43.


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