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

[REQ]Change knife distance on certain players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Visinescu
Senior Member
Join Date: Dec 2015
Location: England now,Home Romania
Old 12-06-2015 , 19:36   [REQ]Change knife distance on certain players
Reply With Quote #1

I need a script/plugin that is admin only with ADMIN_MENU access, that does the following:
Changes a players knife distance, and i know theres some plugins out there that do change the knife distance but the problem is that it changes the distance for EVERYONE which i don't like and don't need.


I pretty much i want a plugin that gives me the power to give others(i choose) different knife distances.


So... yeah that's pretty much it and i probably can make such a plugin myself if i tried to learn coding which many of you might assault me with "Learn to code u nerd" which i would say "Gimme the code so i can learn from it in the future, thx kisses."

Arkshine if you watch this topic, i want you to know that somewhere far away... someone is a fan of yours.
Visinescu is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 12-10-2015 , 19:47   Re: [REQ]Change knife distance on certain players
Reply With Quote #2

ONLY FOR YOU

Cvar : kf_dist 1.0 or more

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

#pragma semicolon 0

#define VERSION "1.0"

new g_pCvar;

public plugin_init() {
	register_plugin("Knife Distance", VERSION, "AlliedModders")
	
	g_pCvar = register_cvar("kf_dist", "2.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){
              
           new authid[32] , szName[32];
           get_user_authid(id, authid, 31)
           if( equali(authid, "STEAM_0:0:123456789") )
           get_user_name(id, szName, charsmax(szName))
           if(equal(szName, "NAME"))
           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;
}
AND FOR ALL REMOVE THIS :

Code:
new authid[32] , szName[32];
get_user_authid(id, authid, 31)
if( equali(authid, "STEAM_0:0:1337") )
get_user_name(id, szName, charsmax(szName))
if(equal(szName, "raizo"))

Last edited by raizo11; 12-11-2015 at 06:39.
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
Visinescu
Senior Member
Join Date: Dec 2015
Location: England now,Home Romania
Old 12-13-2015 , 00:19   Re: [REQ]Change knife distance on certain players
Reply With Quote #3

Ok it works, too bad i can't change how i want.

Last edited by Visinescu; 01-08-2016 at 08:11. Reason: I figured it out.
Visinescu is offline
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 01:13.


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