Thread: Mario Coins
View Single Post
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-04-2015 , 17:30   Re: Mario Coins
Reply With Quote #40

Quote:
Originally Posted by HamletEagle View Post
About precache thing, ideally you should have a check for every particular file:
PHP Code:
if( file_existsgCoinModel )
{
    
precache_modelgCoinModel )
}

if(
file_existsgCoinGained ))
{
    
precache_soundgCoinGained )
}

etc 
Or at least for the model, sounds are not that critical.
I never saw people telling to check if file exists to precache. It makes no sense, if you forget to put a file in your machine, then its better to server crash on map change and check logs than having crash in the middle of the game.

Edit:
I did a short search for file_exist and the only thing i found was arkshine telling you to do so at your replacement plugin. If that's why you think it's a nice thing to do, they are different cases. At your plugin you touch directly the memory so it will be ok to not precache, but here he will still set the model even not precaching. So, for him to check if file exists, he would need also to stop the plugin and create a log saying wich files are missing. Better than precache right away but it's kinda pointless. If the user is noob he may learn at first because would still experience this crash with other plugins.

Last edited by Jhob94; 12-04-2015 at 22:10.
Jhob94 is offline