AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Modify this simple lines please (https://forums.alliedmods.net/showthread.php?t=305590)

AG ATT kool 02-25-2018 13:04

Modify this simple lines please
 
1 Attachment(s)
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;
}

Relaxing 02-25-2018 13:54

Re: Modify this simple lines please
 
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; }

heroicpower7613 02-25-2018 17:41

Re: Modify this simple lines please
 
1 Attachment(s)
Quote:

Originally Posted by Relaxing (Post 2580127)
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


All times are GMT -4. The time now is 00:57.

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