Quote:
Originally Posted by Bugsy
Small/less lines is not the goal.
|
its the most important goal in scripting (SO NEW CODERS CAN UNDERSTAND WHAT THE F IS GOING ON) instead of lost in unnecessary twists and loops
Quote:
101's plugin is spamming the cs_set_user_zoom() native for all players during freeze time. This is a shortcut approach.
My plugin blocks attack2 (zoom) only when a player tries to use it, which is more efficient.
|
if
hook-user-zoom is easier for metamod than
set-user-zoom , then i'm
SORRY
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
new FMPreThink;
public plugin_init()
{
register_event("HLTV","FreezeTimeStart","a","1=0","2=0");
register_logevent("FreezeTimeEnd",2,"1=Round_Start");
}
public FreezeTimeStart()
FMPreThink=register_forward(FM_PlayerPreThink,"FB_PreThink");
public FreezeTimeEnd()
unregister_forward(FM_PlayerPreThink,FMPreThink);
public FB_PreThink(id)
if (cs_get_user_zoom(id))
cs_set_user_zoom(id,CS_SET_NO_ZOOM,1);
it's better 4 u to ally in-order to Write a
fully simple f guide of how natives and hooks work in metamod instead of blaming others , and thats y this site is full of ?questions? .
By the way , Your Code is So Prefect , but u have to know that :
Ham_Weapon_SecondaryAttack is "spamming" another native !