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

Suggestion / Subplugin Request [REQ/HELP] VIP Model on ADMIN_LEVEL_H


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GraviAnt
Senior Member
Join Date: Oct 2010
Old 10-31-2014 , 14:15   [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #1

Can somebody make this plugin compatible with ZM mod?

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

#define ACCESS_FLAG ADMIN_LEVEL_H
#define TASK_DELAY 0.5
#define TASK_MODEL 100
#define MODEL_PLAYER "vip"

new const VERSION[] = "1.0"

new pcvar_on

new g_has_custom_model[33],g_player_model[33][32],Float:g_models_counter

public plugin_init()
{
    
register_plugin("Inny model"VERSION"FakeNick")
    
pcvar_on register_cvar("model_on","1")
    if(
get_pcvar_num(pcvar_on))
    {
        
register_logevent("event_round_end"2"1=Round_End")
        
        
RegisterHam(Ham_Spawn,"player","func_spawn",1)
        
        
register_forward(FM_SetClientKeyValue"fw_key_value")
        
register_forward(FM_ClientUserInfoChanged"fw_user_info_changed")
    }
}
public 
plugin_precache()
{
    new 
path[100]
    
formatex(path,sizeof path 1,"models/player/playcs/%s.mdl",MODEL_PLAYER)
    
engfunc(EngFunc_PrecacheModel,path)
}
public 
func_spawn(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & ACCESS_FLAG)
        {
            
copy(g_player_model[id], sizeof g_player_model[] - 1MODEL_PLAYER)
        
            new 
currentmodel[32]
            
fm_get_user_model(idcurrentmodelsizeof currentmodel 1)
        
            if (!
equal(currentmodelg_player_model[id]))
            {
                
set_task(1.0 g_models_counter"task_set_model"id+TASK_MODEL)
            
                
g_models_counter += TASK_DELAY
            
}
        }else if (
g_has_custom_model[id])
        {
            
fm_reset_user_model(id)
        }
    }
}
public 
event_round_end()
{
    
g_models_counter 0.0
}
public 
fw_key_value(id, const infobuffer[], const key[])
{   
    if (
g_has_custom_model[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE
        
    
return FMRES_IGNORED
}
public 
fw_ClientUserInfoChanged(id)
{
    if (!
g_has_custom_model[id])
        return 
FMRES_IGNORED

    
static currentmodel[32]
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1)
    
    if (!
equal(currentmodelg_player_model[id]))
        
fm_set_user_model(idg_player_model[id])
    
    return 
FMRES_IGNORED
}
public 
task_set_model(id)
{
    
id -= TASK_MODEL
    
    fm_set_user_model
(idg_player_model[id])
}
stock fm_set_user_model(player, const modelname[])
{
    
engfunc(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modelname)
    
    
g_has_custom_model[player] = true
}

stock fm_get_user_model(playermodel[], len)
{
    
engfunc(EngFunc_InfoKeyValueengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modellen)
}

stock fm_reset_user_model(player)
{
    
g_has_custom_model[player] = false
    
    dllfunc
(DLLFunc_ClientUserInfoChangedplayerengfunc(EngFunc_GetInfoKeyBufferplayer))

GraviAnt is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 10-31-2014 , 16:10   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #2

You need to write for what version of ZP you want it.
__________________
H.RED.ZONE is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 10-31-2014 , 19:09   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #3

4.3
GraviAnt is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 10-31-2014 , 19:51   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #4

ZP 4.3 has problems in changing models, so try first one in case it doesn't work try the other one.

To change models just change this line:
Code:
new const human_vip_model[] = "models/player/human_vip.mdl"
new const zombie_vip_model[] = "models/player/zombie_vip.mdl"
Attached Files
File Type: sma Get Plugin or Get Source (zp_vip_model.sma - 538 views - 917 Bytes)
File Type: sma Get Plugin or Get Source (zp_vip_model2.sma - 603 views - 949 Bytes)
__________________

Last edited by H.RED.ZONE; 10-31-2014 at 19:52.
H.RED.ZONE is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 11-01-2014 , 04:22   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #5

I got this error message when I try to compile:
Code:
Error: Undefined symbol "zp_override_user_model" on line 34
Error: Undefined symbol "zp_override_user_model" on line 36

2 Errors.
Also I don't need it for zombies, just for humans.
GraviAnt is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-01-2014 , 04:51   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #6

As far as I know, only ZP5.0 and above version that support human class.
zmd94 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 11-01-2014 , 10:14   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #7

From the main ZP post u need to have "zp_plugin_43_patched.zip"
So that u get the latest version of Zombie plague 4.3 with native "zp_override_user_model" in case u want that plugin to work.
__________________
H.RED.ZONE is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 11-01-2014 , 11:07   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #8

Oh so stupid
It's not working, it downloads the model but keeps the same one on the player.
GraviAnt is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 11-01-2014 , 12:00   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #9

Did u try both versions?
Do you have any other sub-plugins that change models of a player?
In case you tried both versions and u have no other sub plugins that change models, it is prob not possible cause of lot evens calling to change models in zp4.3 (Add them for VIP).
Suggestion: Set up ZP50 server that is using Model change API by Mercylezz and change it then. Better version (:
__________________
H.RED.ZONE is offline
GraviAnt
Senior Member
Join Date: Oct 2010
Old 11-02-2014 , 04:00   Re: [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #10

I tried both...
Nope, don't have sub-plugins that change player model.
I'll see something about zp50

Thanks for trying to help
GraviAnt 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 03:22.


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