Raised This Month: $ Target: $400
 0% 

Check if file already precached


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 06-19-2014 , 20:30   Check if file already precached
Reply With Quote #1

Okay so i use this to load up my knifes in my ini.
And sometimes i use the same knife 2 times and the server crashes becuse of that.

Now to my question how can i check if the knife is already precached?
Code:
public plugin_precache( )
{
	new cfgdir[64]
	get_localinfo("amxx_configsdir", cfgdir, charsmax(cfgdir))
	format(cfgdir, charsmax(cfgdir), "%s/levelmod.ini", cfgdir)
	
	new file = fopen(cfgdir, "rt");
	
	if( file )
	{
		new i = 0;
		new szLevel[5], sfLineData[128];
		
		while( !feof(file) && i < MaxLevels )
		{
			fgets(file, sfLineData, charsmax(sfLineData));
			
			if( !sfLineData[0] || sfLineData[0] == ';' || sfLineData[0] == '/' && sfLineData[1] == '/' ) continue;
			
			parse(sfLineData, szLevel, charsmax(szLevel), iLevelNames[i], charsmax(iLevelNames[]), iKnife[i][0], charsmax(iKnife[][]), iKnife[i][1], charsmax(iKnife[][]));
			iLevels[i] = str_to_num(szLevel);
			
			precache_model(iKnife[i][0]);
			precache_model(iKnife[i][1]);
			
			i++;
		}

		fclose(file);
	}
	else
	{
		set_fail_state("LevelMod configuration file does not exist");
	}
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
 



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 21:14.


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