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

Downloaded Models not Executed/Visible In-Game


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 03-09-2018 , 06:18   Downloaded Models not Executed/Visible In-Game
Reply With Quote #1

Greetings,

Just here to inquire about a little problem I've been facing with Server Models.
I'm running a reHLDS Deathrun Server with reAMXModX 1.8.3.

I've been wanting to have custom model for Admins specifically with ADMIN_SLAY access and here I found this little plugin that does just what I want.

Now the case is, for some reason, I'm facing the exact same problem is this guy in this thread.

Model downloads successfully, but somehow just doesn't show up on a player. All players are just with the standard HL-Models. I tried opening the specific model I was trynna install in jed's model viewer and it did load successfully.

Here's my edit in the above mentioned plugin :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
        
register_plugin("AMX Admin Model""1.1.1""whitemike")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

public 
plugin_precache() {
        
precache_model("models/player/banan/banana.mdl")
        
precache_model("models/player/banan/banana.mdl")

        return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
        if (
get_user_flags(id) & ADMIN_SLAY) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"banana")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"banana")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE

You can download banana.mdl here securely to verify if there's any problem with scaling (if that even matters.)

Checked plugins.ini just to see if any other plugins blocks or replaces the custom model, but no sources looked suspicious enough, also verified that it USED to work before, it just stopped suddenly 2 days ago after a mapchange

Tried other code(not mine) to get the thing to actually execute inside the server :

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN_NAME "model_adm"
#define PLUGIN_AUTHOR "Forze"
#define PLUGIN_VERSION "0.1"

#define ADM ADMIN_SLAY

new cvar_model

public plugin_init(){
register_plugin(PLUGIN_NAMEPLUGIN_AUTHORPLUGIN_VERSION);
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
cvar_model register_cvar("adm_model_enable""1")
}

public 
plugin_precache(){
precache_model("models/player/banan/banana.mdl")


return 
PLUGIN_CONTINUE
}

public 
fwHamPlayerSpawnPost(id){  
   if(!
get_pcvar_num(cvar_model))
   {
      if(
get_user_flags(id) & ADM)
      {
      
cs_reset_user_model(id)
      }
   }  
   else
   {
   
   if(
get_user_flags(id) & ADM)
   {    
   
cs_set_user_model(id"banana")
   }
   }


At the end of the day, whatever code I've tried to put in, has the exact same behaviour of not making the models visible in the server but does download the model to all clients/connections.

Here's my server.cfg :
PHP Code:
deleted by self 
Tried putting the .amxx on top of the plugins.ini to completely prioritize the models execution over any other, returning with no luck.

So, I'm out here trying to find some luck, and just kinda come up with something for this small problem.

Hope the details provided were enough to analyze the problem.

Thanks for considering this post.

Kindest Regards,
ZEDD
__________________

Last edited by ZEDD_Intensity; 03-24-2018 at 08:44.
ZEDD_Intensity is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-09-2018 , 12:21   Re: Downloaded Models not Executed/Visible In-Game
Reply With Quote #2

1.AMXX 1.8.3 has support for rehlds/regamedll so please use that instead of reamxx.
2.You should post in scripting help or suggestions/requests forum.
3.You are using a very old plugin with a horrible method of changing player models, I strongly advise you not to use that.
__________________
HamletEagle is online now
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 03-10-2018 , 02:32   Re: Downloaded Models not Executed/Visible In-Game
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
1.AMXX 1.8.3 has support for rehlds/regamedll so please use that instead of reamxx.
2.You should post in scripting help or suggestions/requests forum.
3.You are using a very old plugin with a horrible method of changing player models, I strongly advise you not to use that.
Hi there,

Thanks for your cooperative response, HamelEagle.

First off, I apologize for misposting the thread in the wrong section, It'd be totally fine if you could move it out to "Scripting Help", I'll make sure I post the right thing under the right title from the next time.

Secondarily, for...
Quote:
Originally Posted by HamletEagle View Post
3.You are using a very old plugin with a horrible method of changing player models, I strongly advise you not to use that.
I've tried searching a whole lot out there to find a code that isn't new but I couldn't figure out and basically tried everything I could find out there. If you could do me a huge favor, could you please link me to where the "Updated" plugin is? I'd really appreciate a link that you suggest as that'd make sure I'm using nothing but the Classic of a code.

Again, I realize this is slowly turning into "Scripting Help", but I'll definitely rethink about where I post my stuff.

For 1) I never knew stock version of AMXX1.8.3 supported ReGameDLL/reHLDS at all, Thanks for letting me know. For now, I'll keep that step at the end as I'd love to try with your #3 as the code I'm using is old. After updating it, if that doesn't work, I'll rethink if I really want models on my server or not, because switching AMXX may or may not cause problems in the smooth functionality of the server, i.e. Crashes. Currently, my server running over 125 plugins is so far so good with no error log since months, i know its a lot to handle for the CPU, but it hasn't called out for a rescue since a while, so I'd love to keep the versions the same as far as its not forcibly needed to do.

Anyways, Thanks again. Looking forward to any help, to be appreciated.

Thanks and Regards,
ZEDD

UPDATE :
I tried this, pretty everything in this entire thread :
Quote:
Originally Posted by edon1337 View Post
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >

#define VIP_FLAG ADMIN_LEVEL_H

new const g_szVipModelT[ ] = "vip_model_t" ;
new const 
g_szVipModelCT[ ] = "vip_model_ct" ;

public 
plugin_init( ) {

    
register_plugin"VIP Model""1.0""DoNii" ) ;

    
register_forwardFM_SetClientKeyValue"fw_FMSetClientKeyValuePre") ;
    
    
RegisterHamHam_Spawn"player""fw_HamSpawnPost") ;
}

public 
plugin_precache( ) {

    new 
szModelT64 ], szModelCT64 ] ;
    
    
formatexszModelTcharsmaxszModelT ), "models/player/%s/%s.mdl"g_szVipModelTg_szVipModelT ) ;
    
precache_modelszModelT ) ;
    
    
formatexszModelCTcharsmaxszModelCT ), "models/player/%s/%s.mdl"g_szVipModelCTg_szVipModelCT ) ;
    
precache_modelszModelCT ) ;
}

public 
fw_HamSpawnPostid ) {

    if( ! 
is_user_aliveid ) )
    return 
HAM_IGNORED ;
    
    if( ~ 
get_user_flagsid ) & VIP_FLAG )
    return 
HAM_IGNORED ;
    
    switch( 
get_user_teamid ) ) {
        
    case 
1: {
            
            
set_user_infoid"model"g_szVipModelT ) ;
        }
        
    case 
2: {
            
            
set_user_infoid"model"g_szVipModelCT ) ;
        }
    }

    return 
HAM_IGNORED ;
}

public 
fw_FMSetClientKeyValuePreiPlayer, const szBuffer[ ], const szKey[ ] ) {

    if( 
equalszKey"model" ) ) {
        
        if( 
get_user_flagsiPlayer ) & VIP_FLAG ) {

            switch( 
get_user_teamiPlayer ) ) {
                
            case 
1: {
                    
                    
set_user_infoiPlayer"model"g_szVipModelT ) ;
                    return 
FMRES_SUPERCEDE ;
                }
                
            case 
2: {
                    
                    
set_user_infoiPlayer"model"g_szVipModelCT ) ;
                    return 
FMRES_SUPERCEDE ;
                }
            }
        }
    }
    
    return 
FMRES_IGNORED ;

Weird that it worked for the OP but just won't show the model up In-Game, It downloads the model for sure, JUST won't show up. The code looks extremely functional itself.
Any help is appreciated.
__________________

Last edited by ZEDD_Intensity; 03-10-2018 at 03:59.
ZEDD_Intensity is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-12-2018 , 16:17   Re: Downloaded Models not Executed/Visible In-Game
Reply With Quote #4

I suggest to disable all other plugins and test only the model changer. You may have a plugin that sets models back.
Btw, are you using cl_minmodels?

The plugin you quoted is more close to what you should be using. Tho, notice that it only sets models for admins with ADMIN_LEVEL_H.
__________________

Last edited by HamletEagle; 03-12-2018 at 16:18.
HamletEagle is online now
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 03-13-2018 , 03:26   Re: Downloaded Models not Executed/Visible In-Game
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
I suggest to disable all other plugins and test only the model changer. You may have a plugin that sets models back.
Btw, are you using cl_minmodels?

The plugin you quoted is more close to what you should be using. Tho, notice that it only sets models for admins with ADMIN_LEVEL_H.
Hi there,

I've never used cl_minmodels. After reviewing some other threads related to that CVar, I tried setting it on 0, which made no difference. Setting it to 1 basically forces the default leet/gign models which will be visible to every client, if I'm not wrong. I tried setting it to 0, which didn't make any difference.

The tricky part is, I disabled literally every single plugin on the server with nothing but the code I quoted in my previous reply and the 3rd Person Camera plugin (Which doesn't reset models) so I can watch my character. It still didn't function properly. No model came up even with every plugin disabled

I've edited it to work with ADMIN_RESERVATION access. Please let me know if I missed anything :
PHP Code:
code removed by self 
Absolutely weird as far as I don't see any particular thing that could be causing the problem, at all! I hope someone as experienced as you can see what's going on around the situation.

Appreciate your replies.

Regards,
ZEDD
__________________

Last edited by ZEDD_Intensity; 03-25-2018 at 08:06.
ZEDD_Intensity is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-13-2018 , 13:54   Re: Downloaded Models not Executed/Visible In-Game
Reply With Quote #6

Before telling you what's wrong I want to say you should ALWAYS do some debugging. Put some messages around if check and functions, and based off this messages you will know what code gets executed and what not(see message, means code is executed).

Your did some mistakes. All you should have edited in the original plugin are this two constants:
PHP Code:
new const g_szVipModelT[ ] = "vip_model_t" ;
new const 
g_szVipModelCT[ ] = "vip_model_ct" 
Because you don't know yet what you are doing and since you seem to want a single model for both teams, just set this two constant to "banana" without making any other modifications to the code.

Now, if you want to know some things you did wrong:
PHP Code:
 if( equalszKey"banana" ) ) { 
The key is "model", what you did is create a condition that won't ever be true. key is not the model that you want to set, but the property. Same story in set_user_info, it should be model.

What it should look like is:
PHP Code:
  set_user_infoiPlayer"model"g_szVipModelT ) ; 
assuming that you changed g_szVipModelT to banana. Alternatively(but it's considered bad practice) you could do directly:
PHP Code:
 set_user_infoiPlayer"model""banana") ; 
PHP Code:
formatexszModelTcharsmaxszModelT ), "models/player/banana.mdl"g_szVipModelTg_szVipModelT ) ; 
    
precache_modelszModelT ) ; 
     
    
formatexszModelCTcharsmaxszModelCT ), "models/player/banana.mdl"g_szVipModelCTg_szVipModelCT ) ; 
You basically hard coded the models, there's not need to have , g_szVipModelCT, g_szVipModelCT after "models/player/banana.mdl".
__________________

Last edited by HamletEagle; 03-13-2018 at 13:55.
HamletEagle is online now
ZEDD_Intensity
Senior Member
Join Date: Jun 2016
Old 03-15-2018 , 11:46   Re: Downloaded Models not Executed/Visible In-Game
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
Before telling you what's wrong I want to say you should ALWAYS do some debugging. Put some messages around if check and functions, and based off this messages you will know what code gets executed and what not(see message, means code is executed).
Your did some mistakes. All you should have edited in the original plugin are this two constants:
PHP Code:
new const g_szVipModelT[ ] = "vip_model_t" ;
new const 
g_szVipModelCT[ ] = "vip_model_ct" 
Because you don't know yet what you are doing and since you seem to want a single model for both teams, just set this two constant to "banana" without making any other modifications to the code.
Hey,
Definitely something to learn right there. Just to make sure I follow it correctly, here's the edit again :
PHP Code:
 thanks 
__________________

Last edited by ZEDD_Intensity; 04-23-2018 at 06:21. Reason: thanks
ZEDD_Intensity is offline
Reply


Thread Tools
Display Modes

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 05:38.


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