Thread: ZP VIP System
View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 11-09-2019 , 05:42   Re: ZP VIP System
Reply With Quote #4

This code seems like a bunch of copy-pasting, especially Elite Admin System.

Suggestions:
1. You're only pre-caching 1 model from the array, then breaking the loop, resulting into server crash because of un-precached models.
PHP Code:
public plugin_precache(){
    
g_playerData ArrayCreate(PlayerData);
    
    
ReloadFile();
    
    new 
iPlayer[PlayerData];
    
    for(new 
iArraySize(g_playerData); i++)
    {
        
ArrayGetArray(g_playerData,i,iPlayer)
        new 
szModel[64]
        if(
iPlayer[Player_ModelCT][0])
        {
            
formatex(szModel,charsmax(szModel),"models/player/%s/%s.mdl",iPlayer[Player_ModelCT],iPlayer[Player_ModelCT])
            
precache_model(szModel)
        }
        
        if(
iPlayer[Player_ModelT][0])
        {
            
formatex(szModel,charsmax(szModel),"models/player/%s/%s.mdl",iPlayer[Player_ModelT],iPlayer[Player_ModelT])
            
precache_model(szModel)
        }
        break;
    }

2. Don't use ResetHUD to set models, it's not the appropriate event.

3. Implement ML
__________________

Last edited by edon1337; 11-09-2019 at 05:52.
edon1337 is offline