Quote:
Originally Posted by abē
could you give an example for use prethink - would be great!
|
Are we sure there isn't better way?
Code:
/*
Who said I should use engine?!
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#define PLUGIN "Ab2's AWESOME zoom plugin"
#define VERSION "1.0"
#define AUTHOR "What a hey"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_forward(FM_PlayerPreThink, "PreThink");
}
public PreThink(id)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
new dummy, more_dummy, weapon;
weapon = get_user_weapon(id, dummy, more_dummy);
if(weapon != CSW_AWP)
return FMRES_IGNORED;
/* If you wanted that awp zooms like aug*/
if(cs_get_user_zoom(id) == CS_SET_FIRST_ZOOM || cs_get_user_zoom(id) == CS_SET_SECOND_ZOOM)
cs_set_user_zoom(id, CS_SET_AUGSG552_ZOOM, 1);
return FMRES_IGNORED;
}