Raised This Month: $ Target: $400
 0% 

Admin HOOK - Trying to add ZP functions.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iNspiratioN
Member
Join Date: Feb 2009
Location: Lithuania
Old 03-27-2009 , 14:41   Admin HOOK - Trying to add ZP functions.
Reply With Quote #1

I tried to edit - ADMIN HOOK plugin by AssKicR, but i confused in that "HOOK Giving"

Orginal Link to ADMIN HOOK - http://forums.alliedmods.net/showthread.php?t=17778

I want to add ZP functions like - when admin changes into zombie - he would lose the HOOK and if he changes back into human - he would get his hook back.

I tried this:

PHP Code:
public zp_user_infected_post(idinfector)
{
    if(
gAllowedHook[id] || (get_user_flags(id)&ADMIN_LEVEL_E) && zp_get_user_zombie(id))
    {
        
gAllowedHook[id] = false  
    
}
}

public 
zp_user_humanized_post(id)
{
    if(
gAllowedHook[id] || (get_user_flags(id)&ADMIN_LEVEL_E) && !zp_get_user_zombie(id))
    {
        
gAllowedHook[id] = true
    
}

and some couple of ways but nothing..
__________________
iNspiratioN is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 03-27-2009 , 17:19   Re: Admin HOOK - Trying to add ZP functions.
Reply With Quote #2

Quote:
Originally Posted by iNspiratioN View Post

PHP Code:
public zp_user_humanized_post(id)
{
    if(
gAllowedHook[id] || (get_user_flags(id)&ADMIN_LEVEL_E) && !zp_get_user_zombie(id))
    {
        
gAllowedHook[id] = true
    
}

maybe this is the point
in your code player is allready allowedhook[id] when checking
and then you set him again allowedhook[id]

so you have to check if not allowedhook[id]
then set him allowedhook[id]
PHP Code:
    if(!gAllowedHook[id] || (get_user_flags(id)&ADMIN_LEVEL_E) && !zp_get_user_zombie(id)) 
do you want to remove only admin hook or form everyone who is zombie id
and has hook id and then give it back if not zombie id and has no hook id ???
__________________

Last edited by vato loco [GE-S]; 03-27-2009 at 19:54.
vato loco [GE-S] is offline
iNspiratioN
Member
Join Date: Feb 2009
Location: Lithuania
Old 03-28-2009 , 03:47   Re: Admin HOOK - Trying to add ZP functions.
Reply With Quote #3

Quote:
Originally Posted by vato loco [GE-S]
do you want to remove only admin hook or form everyone who is zombie id
and has hook id and then give it back if not zombie id and has no hook id ???
Yes, i want when ADMIN is infected(is zombie) he loses his HOOK - and when he CHANGES BACK IN TO HUMAN(Uses AntiDote or other ways) he would get his HOOK back.
__________________
iNspiratioN 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 09:01.


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