Raised This Month: $ Target: $400
 0% 

pev_skin not working with v_model


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-02-2020 , 20:13   pev_skin not working with v_model
Reply With Quote #1

am I doing something wrong, or does pev_skin not even work with view models?
this is the test plugin I was using:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>

new const model[] = "models/custom_v_m4a1.mdl"//models directory and name.

new user_skin[MAX_PLAYERS+1]

new const 
skin_names[][] = {
    
"skin 1",
    
"skin 2",
    
"skin 3",
    
"skin 4",
    
"skin 5",
    
"skin 6"
}

public 
plugin_init() {
    
register_event"CurWeapon","Event_CurWeapon","be""1=1" )
    
register_clcmd("say /skin""skin_menu")
}
public 
plugin_precache() {
    
precache_model(model)
}
public 
skin_menu(id) {
    new 
menu_name[] = "choose skin:"
    
new mid menu_create(menu_name"skin_menu_handler")

    for(new 
ii<sizeof(skin_names); i++) {
        
menu_additem(midskin_names[i], "")
    }

    
menu_setprop(midMPROP_EXITMEXIT_ALL)
    
menu_display(idmid)
}
public 
skin_menu_handler(idmiditem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(mid)
        return 
PLUGIN_HANDLED
    
}
    
    
user_skin[id] = item
    
if(is_user_alive(id)) {
        new 
wpn cs_get_user_weapon_entity(id)
        
set_pev(wpnpev_skinitem)
    }
    
menu_destroy(mid)
    
Event_CurWeapon(id)
    
skin_menu(id)
    return 
PLUGIN_HANDLED
}
public 
Event_CurWeapon(id) {
    if(
is_user_alive(id) && get_user_weapon(id) == CSW_M4A1) {
        
        
set_pev(idpev_viewmodel2model)
        
client_print(idprint_chat"%i"user_skin[id])
        new 
wpn cs_get_user_weapon_entity(id)
        
set_pev(wpnpev_skinuser_skin[id])
    }

model itself: model
__________________
retired chump
DjSoftero is offline
 



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


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