View Single Post
101
Member
Join Date: Nov 2023
Old 12-04-2023 , 22:29   Re: no aim on Freeze Time
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
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 !

Last edited by 101; 12-04-2023 at 22:48.
101 is offline