Raised This Month: $51 Target: $400
 12% 

Knife For Specific Authid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 12-09-2015 , 20:24   Knife For Specific Authid
Reply With Quote #1

I want to Change Knife Distance only for specific Authid :


Code:
#include <amxmodx>
#include <fakemeta>

#include <xs>

#pragma semicolon 0

#define VERSION "0.1"

new g_pCvar;

public plugin_init() {
	register_plugin("Knife Distance", VERSION, "Test")
	
	g_pCvar = register_cvar("knife_rangemultiplier", "1.0");
	
	register_forward(FM_TraceLine, "fwTraceline")
	register_forward(FM_TraceHull, "fwTracehull", 1)
}

public fwTraceline(Float:fStart[3], Float:fEnd[3], conditions, id, ptr){
	return vTrace(id, ptr,fStart,fEnd,conditions)
}

public fwTracehull(Float:fStart[3], Float:fEnd[3], conditions, hull, id, ptr){
	return vTrace(id, ptr,fStart,fEnd,conditions,true,hull)
}

vTrace(id, ptr,Float:fStart[3],Float:fEnd[3],iNoMonsters,bool:hull = false,iHull = 0){
	if(is_user_alive(id) && get_user_weapon(id) == CSW_KNIFE){
		
		xs_vec_sub(fEnd,fStart,fEnd)
		xs_vec_mul_scalar(fEnd,get_pcvar_float(g_pCvar),fEnd);
		xs_vec_add(fEnd,fStart,fEnd);
		
		hull ? engfunc(EngFunc_TraceHull,fStart,fEnd,iNoMonsters,iHull,id,ptr) : engfunc(EngFunc_TraceLine,fStart,fEnd,iNoMonsters, id,ptr)
	}
	
	return FMRES_IGNORED;
}
Fixed Thanks

Code:
new authid[32] 
    get_user_authid(id, authid, 31)
      
    if( equali(authid, "STEAM_0:0:12345678") )

Last edited by raizo11; 12-09-2015 at 21:14.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Reply



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 12:17.


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