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

Modify this simple lines please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AG ATT kool
Junior Member
Join Date: Dec 2017
Location: Algeria
Old 02-25-2018 , 13:04   Modify this simple lines please
Reply With Quote #1

Hi AlliedModders, I have this knife distance plugins. Can Anyone make it admin only please?!
This is the code used.


#include <amxmodx>
#include <fakemeta>

#include <xs>

#pragma semicolon 0

#define VERSION "0.1"

new g_pCvar;

public plugin_init() {
register_plugin("Modified Knife Distance", VERSION, "diablix & DarkGL")

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_pCva r),fEnd);
xs_vec_add(fEnd,fStart,fEnd);

hull ? engfunc(EngFunc_TraceHull,fStart,fEnd,iNoMons ters,iHull,id,ptr) : engfunc(EngFunc_TraceLine,fStart,fEnd,iNoMons ters, id,ptr)
}

return FMRES_IGNORED;
}
Attached Files
File Type: sma Get Plugin or Get Source (knife.sma - 505 views - 1.1 KB)
AG ATT kool is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-25-2018 , 13:54   Re: Modify this simple lines please
Reply With Quote #2

Here's a thing
Code:
new bool: is_he_really_an_admin[32]; public client_putinserver(id){     if (is_user_admin(id))         is_he_really_an_admin[id] = true; } public client_disconnected(id){     if (is_he_really_an_admin[id])         is_he_really_an_admin[id] = false; }
__________________
Relaxing is offline
heroicpower7613
Member
Join Date: Nov 2016
Old 02-25-2018 , 17:41   Re: Modify this simple lines please
Reply With Quote #3

Quote:
Originally Posted by Relaxing View Post
Here's a thing
Code:
new bool: is_he_really_an_admin[32]; public client_putinserver(id){     if (is_user_admin(id))         is_he_really_an_admin[id] = true; } public client_disconnected(id){     if (is_he_really_an_admin[id])         is_he_really_an_admin[id] = false; }
come on dude, this is the requests section. the guy probably don't know shit about this stuff.

Spoiler
Attached Files
File Type: sma Get Plugin or Get Source (knife_dist.sma - 489 views - 1.2 KB)
heroicpower7613 is offline
Reply


Thread Tools
Display Modes

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:20.


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