Raised This Month: $ Target: $400
 0% 

Proplem with setting view model


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Explas
Junior Member
Join Date: Nov 2009
Old 11-15-2011 , 23:18   Proplem with setting view model
Reply With Quote #1

Hi, everyone
Today i'm trying to make dotsight for the aug, it worked, however, when i switch to another weapon, its view model is set to the aug!
Can anyone fix it for me?
Here is the code:
[php]
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <engine>
#include <hamsandwich>

#define PLUGIN "Scope Dot"
#define VERSION "1.0"
#define AUTHOR "Explas"


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_PlayerPreThink, "PlayerPreThink")

// Add your code here...
}
/[php]
public plugin_precache()
{
precache_model("models/v_aug_scope.mdl")
precache_model("models/v_aug.mdl")
}

public PlayerPreThink(id)
{
if( get_user_weapon(id) == CSW_AUG)
{
if( cs_get_user_zoom(id) == CS_SET_AUGSG552_ZOOM)
{
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, "models/v_aug_scope.mdl"))
}
if( cs_get_user_zoom(id) == CS_SET_NO_ZOOM)
{

set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, "models/v_aug.mdl"))
}
}

}

Last edited by Explas; 11-15-2011 at 23:22.
Explas 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 08:29.


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