Raised This Month: $ Target: $400
 0% 

Checks fail all the time?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 05-03-2010 , 13:33   Checks fail all the time?
Reply With Quote #1

I don't know where to post this since it is a mix of SH mod and ZP mod, and I hope you guys in here can help me.

What I want to do, is to make a check to see if a player is a zombie or not, if he is, then set the SH powers. If I do this, it works, but ofc. for both zombie and survivor:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <superheromod>
#include <zombieplague>

new gHeroID
new const gHeroName [] = "Test"
new bool:gHasTest[SH_MAXSLOTS+1]
//pcvars
new pcvarHealthpcvarArmor

public plugin_init()
{
    
register_plugin("SUPERHERO Test""1.0""Jelle")
    
    
//cvars
    
new pcvarLevel register_cvar("test_level""5")
    
pcvarHealth register_cvar("test_health""2000")
    
pcvarArmor register_cvar("test_armor""2000")
    
    
//create hero and hero info
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Test""Testing")
}

public 
sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return
    
    switch(
mode)
    {
        case 
SH_HERO_ADD:
        {
            
gHasTest[id] = true
            set_power
(id)
        }
        case 
SH_HERO_DROP:
        {
            
gHasTest[id] = false
        
}
    }
}

public 
sh_client_spawn(id)
{
    
set_power(id)
}

set_power(id)
{
    if (
gHasTest[id] && is_user_alive(id))
    {
        
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor)
    }

Then I tried this:

PHP Code:
set_power(id)
{
    if (
gHasTest[id] && is_user_alive(id) && zp_get_user_survivor(id))
    {
        
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor)
    }

This gave no help also. Then I tried with a task, since the zombie is found about 10 - 15 seconds in the game, but that did not work either. Then I tried this:

PHP Code:
set_power(id)
{
    if (
zp_get_user_zombie(id) && zp_get_user_nemesis(id)) return
    
    if (
gHasTest[id] && is_user_alive(id))
    {
        
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor)
    }

This did not help either. So now I turn to you guys, do you have any suggestions?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
 



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 03:36.


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