Raised This Month: $ Target: $400
 0% 

Map features fix code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
emoto2
Member
Join Date: May 2016
Old 06-26-2016 , 20:27   Map features fix code
Reply With Quote #1

Need to fix this simple plugin... when add options on ini files not working correctly (no have effect/have, no have fog/have, fog color not real or other color)
Code:
#include <amxmodx> #include <engine> #include <fakemeta> public plugin_precache() {       new file[39], mapname[64]     get_mapname(mapname,63)     format(file,38,"addons/amxmodx/configs/map_sky_fog.ini")         if(file_exists(file))     {         new map[64],skyname[32],lights[2],w_effects[2],fog_dens[7],fog_color[12]         for(new i=0;i <= file_size(file, 1) - 1;i++)         {             new data[38],buffer             read_file(file,i,data,37,buffer)             parse(data, map,63, skyname,31, lights,1, w_effects,1, fog_dens,6, fog_color,11)                         if(equali(mapname,map))             {                 if(!equali(skyname,"")) server_cmd("sv_skyname %s",skyname)                 if(!equali(lights,"")) set_lights(lights)                                 if(equali(w_effects,"1"))                 {                     create_entity("env_rain")                 } else if(equali(w_effects,"2"))                 {                     create_entity("env_snow")                 }                                 if(!equali(fog_dens,"0") && !equali(fog_dens,"0.0"))                 {                     new ent = create_entity("env_fog")                     if(ent)                     {                         fm_set_kvd(ent,"density",fog_dens,"env_fog")                         fm_set_kvd(ent,"rendercolor",fog_color,"env_fog")                     }                 }             }         }     } else {         log_amx("Sorry, but I can't find configs/map_sky_fog.ini!")     } } public plugin_init() {     register_plugin("Map sky and fog", "1.0", "<VeCo>") } stock fm_set_kvd(entity, const key[], const value[], const classname[]) {     set_kvd(0, KV_ClassName, classname)     set_kvd(0, KV_KeyName, key)     set_kvd(0, KV_Value, value)     set_kvd(0, KV_fHandled, 0)     dllfunc(DLLFunc_KeyValue, entity, 0) }
emoto2 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 10:02.


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