Raised This Month: $ Target: $400
 0% 

Only admins.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kaspet
Member
Join Date: Jan 2009
Old 12-24-2009 , 18:03   Only admins.
Reply With Quote #1

Hello.
How can i add a code to this script?
/*
* _______ _ _ __ __
* | _____/ | | | | \ \ __ / /
* | | | | | | | | / \ | |
* | | | |____| | | |/ __ \| |
* | | ___ | ______ | | / \ |
* | | |_ | | | | | | / \ |
* | | | | | | | | | | | |
* | |____| | | | | | | | | |
* |_______/ |_| |_| \_/ \_/
*
*
*
* Last Edited: 01-05-08
*
* ============
* Changelog:
* ============
*
* v1.0
* -Initial Release
*
*/

#define VERSION "1.0"

#include <chr_engine>

new toggle_pcvar, speed_pcvar, gravity_pcvar, bhop_pcvar

public plugin_init()
{
register_plugin("Long Jump + Bunny Hop","1.0","GHW_Chronic")

toggle_pcvar = register_cvar("longjump_on","1")
speed_pcvar = register_cvar("longjump_speed","500.0")
gravity_pcvar = get_cvar_pointer("sv_gravity")
bhop_pcvar = register_cvar("longjump_bhop","0")

register_forward(FM_PlayerPreThink,"FM_PreThi nk")
}

public FM_PreThink(id)
{
if(get_pcvar_num(toggle_pcvar) && (pev(id,pev_button) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
{
if(get_pcvar_num(bhop_pcvar) || !(pev(id,pev_oldbuttons) & IN_JUMP)) blah(id)
}
}

public blah(id)
{
set_speed(id,get_pcvar_float(speed_pcvar),3)
static Float:velocity[3]
pev(id,pev_velocity,velocity)
velocity[2] = get_pcvar_float(gravity_pcvar) / 3.0
new button = pev(id,pev_button)
if(button & IN_BACK)
{
velocity[0] *= -1
velocity[1] *= -1
}
set_pev(id,pev_velocity,velocity)
}


<<< I mean, i want add the, only admins with flag A can use this two abilities?
Sorry for bad english.
kaspet is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 12-24-2009 , 18:55   Re: Only admins.
Reply With Quote #2

if(get_pcvar_num(toggle_pcvar) && (pev(id,pev_button) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))

-->

if(get_user_flags(id) & ADMIN_LEVEL_A && get_pcvar_num(toggle_pcvar) && (pev(id,pev_button) & IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
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 04:14.


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