AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set model depending on client cvar (https://forums.alliedmods.net/showthread.php?t=26260)

demot 03-29-2006 14:45

set model depending on client cvar
 
hi,
i want to replace the default deagle model with a custom one, but the problem is that this mdl is "cl_righthand" sensitive
that means that i have to set different models depending on the clients cvar "cl_righthand"
first i tried get_user_info() but it didn't work
recently i read that i should use query_client_cvar() instead, but it seems like i can't handle this function

thats what i have so far:
Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <cstrike> public plugin_init() { register_plugin("custom weaponskins","0.1","demot"); register_event("CurWeapon","gun","be","1=1"); } public gun(id) { new clip, ammo new weap = get_user_weapon(id,clip,ammo) if(is_user_alive(id)) { if(weap == CSW_DEAGLE) { entity_set_string(id, EV_SZ_viewmodel, "models/weaponsc/left/v_deagle.mdl") // i know that's not the right way to set mdls entity_set_string(id, EV_SZ_model, "models/weaponsc/w_deagle.mdl") } // but entity_set_model() didn't work, dunno why } } public plugin_precache() { precache_model("models/weaponsc/left/v_deagle.mdl"); precache_model("models/weaponsc/right/v_deagle.mdl"); precache_model("models/weaponsc/w_deagle.mdl"); }

can somebody plz help me to add the query of the client's value of the cvar "cl_righthand"?

btw. /me is noob

v3x 03-29-2006 16:51

Find somebody to convert it to the right hand.


All times are GMT -4. The time now is 16:29.

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