Raised This Month: $32 Target: $400
 8% 

Solved Map-specific .inis for Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CloneCommOmar
New Member
Join Date: Mar 2019
Old 03-26-2019 , 08:57   Map-specific .inis for Plugin
Reply With Quote #1

Hi everyone,

I've recently been trying to find a plugin that allows for custom models on each map (sorta like how CS:GO does it). I was able to find Player Models, however this one did not support custom skins for bots and so is not suitable for me.

After searching, I discovered Custom Models, which allows for editing of Bot skins - however another issue arrived; this one has no support for map-specific .inis (what I mean with this, is have another config for de_dust and another for de_dust2 etc, basically have different model configurations per map).

I've got very little experience with scripting (so far) and have not been able to get this done on my own. Could someone else possibly do it? Thanks.

File attached (as the site is Russian and needs an account).

P.S. I'm not a 'no-steamer' or whatever, you can see I own the game here.
Attached Files
File Type: ini custom_models.ini (561 Bytes, 41 views)
File Type: sma Get Plugin or Get Source (custom_models.sma - 246 views - 4.3 KB)

Last edited by CloneCommOmar; 03-26-2019 at 15:44. Reason: p.s.
CloneCommOmar is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-26-2019 , 14:24   Re: Map-specific .inis for Plugin
Reply With Quote #2

Quote:
P.S. I'm not a 'no-steamer' or whatever, you can see I own the game here.
Owning the game has nothing to do with whether or not your server is Steam-only. However, this question is not in any way related to the plugin.

The easiest way you can do this is by making the plugin open the file named "custom_models-<mapname>.ini" for example. You can even check if the file exists, and if not, open the default "custom_models.ini" file. To do that, simply replace the lines before in the beginning of the "plugin_precache" function, all the way to "fopen" with these:

PHP Code:
new file[256], mapname[32]
get_mapname(mapnamecharsmax(mapname))
formatex(filecharsmax(file), "addons/amxmodx/configs/custom_models-%s.ini"mapname)

if(!
file_exists(file))
{
    
formatex(filecharsmax(file), "addons/amxmodx/configs/custom_models.ini")
}

new 
fp fopen(file"rt"); 
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
CloneCommOmar
New Member
Join Date: Mar 2019
Old 03-26-2019 , 15:06   Re: Map-specific .inis for Plugin
Reply With Quote #3

I was looking at older threads and anyone who asked for something like this was called a nosteamer and other stuff. Just wanted to be sure.

Thanks for helping.
CloneCommOmar 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 12:34.


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