Raised This Month: $ Target: $400
 0% 

.ini File


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-21-2017 , 21:42   .ini File
Reply With Quote #1

I'm trying to copy every single models for a weapon, there're 11 models.

Thats the code i'm using:

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

enum WeapSett
{
    
V_KNIFE,
    
V_M4A1,
    
V_AK47,
    
V_AWP
}

new 
WeaponSkins[WeapSett]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()
{
    new 
szFile[256]
    
get_configsdir(szFilecharsmax(szFile))
    
add(szFilecharsmax(szFile), "/furien_models.ini")

    new 
iFile fopen(szFile"r")

    while (!
feof(iFile))
    {
        new 
szBuffer[512], Key[64], Value[256]

        
fgets(iFileszBuffercharsmax(szBuffer))
        
trim(szBuffer)
        
        if (
szBuffer[0] == EOS || szBuffer[0] == ';' || (szBuffer[0] == '/' && szBuffer[1] == '/'))
            continue

        
strtok(szBufferKeycharsmax(Key), Valuecharsmax(Value), '=')

        
trim(Key)
        
trim(Value)
        
        if(
equal(Key"V_KNIFE"))
        {
            
copy(WeaponSkins[V_KNIFE], charsmax(WeaponSkins[]), Value)
        }
        else if(
equal(Key"V_M4A1"))
        {
            
copy(WeaponSkins[V_M4A1], charsmax(WeaponSkins[]), Value)
        }
        else if(
equal(Key"V_AK47"))
        {
            
copy(WeaponSkins[V_AK47], charsmax(WeaponSkins[]), Value)
        }
        else if(
equal(Key"V_AWP"))
        {
            
copy(WeaponSkins[V_AWP], charsmax(WeaponSkins[]), Value)
        }
        
        for(new 
i;sizeof WeaponSkins;i++)
        {
            
precache_model(WeaponSkins[WeapSett:i])
        }
    }
    
fclose(iFile)

The question is: Is there any format for use instead of 'else if'?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 18:00.


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