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 pcvarHealth, pcvarArmor
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(gHeroName, pcvarLevel)
sh_set_hero_info(gHeroID, "Test", "Testing")
}
public sh_hero_init(id, heroID, mode)
{
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(gHeroID, pcvarHealth, pcvarArmor)
}
}
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(gHeroID, pcvarHealth, pcvarArmor)
}
}
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(gHeroID, pcvarHealth, pcvarArmor)
}
}
This did not help either. So now I turn to you guys, do you have any suggestions?
__________________