Raised This Month: $ Target: $400
 0% 

Kevlar v helm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
A.B.
Member
Join Date: Nov 2009
Old 11-30-2009 , 01:01   Kevlar v helm
Reply With Quote #1

I'm trying to pull kevlarvhelm cvar, however it doesn't seem to work.
get_user_armor is the only thing that I got to compile successfully.

What am I doing wrong.

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
 
#define ADMIN_LEVEL ADMIN_LEVEL_A
 
new cvar, num_of_armor
 
public plugin_init()
{
    register_event("ResetHUD", "hook_resethud", "be")
 
    cvar = register_cvar("armor_enabled", "1")
    num_of_armor = register_cvar("admin_armor", "200")
}
 
 
public hook_resethud(id)
{
    if(get_pcvar_num(cvar) < 1)
    return PLUGIN_CONTINUE
 
    if(get_user_flags(id) & ADMIN_LEVEL)
    set_user_armor(id, get_user_armor(id) + get_pcvar_num(num_of_armor))
 
    return PLUGIN_CONTINUE
}
P.S.
Is it possible to assign a specific amount of gravity to a target?

Last edited by A.B.; 11-30-2009 at 01:05. Reason: Diet cawk
A.B. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2009 , 01:22   Re: Kevlar v helm
Reply With Quote #2

Use cs_[g/s]et_user_armor : http://www.amxmodx.org/funcwiki.php?...rmor&go=search
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
A.B.
Member
Join Date: Nov 2009
Old 11-30-2009 , 02:07   Re: Kevlar v helm
Reply With Quote #3

My miserable brain can't hold that much info. Yeah, I tried it, yet it looks like I'm still missing something. Getting errors.
A.B. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2009 , 02:09   Re: Kevlar v helm
Reply With Quote #4

Just add the admin check to this: http://forums.alliedmods.net/showthread.php?p=806660
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 11-30-2009 , 02:41   Re: Kevlar v helm
Reply With Quote #5

Are you trying to set admin armor to 200 at round start? Or your trying to set admin armor to amount of armor has now + num_of_armor?
Excalibur.007 is offline
Old 11-30-2009, 03:22
A.B.
This message has been deleted by A.B..
Old 11-30-2009, 04:02
A.B.
This message has been deleted by A.B.. Reason: I failed
A.B.
Member
Join Date: Nov 2009
Old 11-30-2009 , 04:29   Re: Kevlar v helm
Reply With Quote #8

Got it.
<3

Last edited by A.B.; 11-30-2009 at 05:16.
A.B. is offline
addicted2sex
Senior Member
Join Date: May 2009
Location: localhost
Old 11-30-2009 , 10:34   Re: Kevlar v helm
Reply With Quote #9

Dont use the resetHUD event for that cuz it's exploitable...
__________________
Let 7he gr0ovE r3Lease y0ur m!nd
addicted2sex is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 11-30-2009 , 10:43   Re: Kevlar v helm
Reply With Quote #10

It's only for admins any way so I don't think he cares if it'll be called a few more times than expected.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
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 13:41.


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