AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin HOOK - Trying to add ZP functions. (https://forums.alliedmods.net/showthread.php?t=88633)

iNspiratioN 03-27-2009 14:41

Admin HOOK - Trying to add ZP functions.
 
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..

vato loco [GE-S] 03-27-2009 17:19

Re: Admin HOOK - Trying to add ZP functions.
 
Quote:

Originally Posted by iNspiratioN (Post 790399)

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 ???

iNspiratioN 03-28-2009 03:47

Re: Admin HOOK - Trying to add ZP functions.
 
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.


All times are GMT -4. The time now is 09:01.

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