Raised This Month: $ Target: $400
 0% 

API Scripting Help [zp50_gamemode]Nemesis spawn with negative/defualt values.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 05-08-2012 , 11:37   [zp50_gamemode]Nemesis spawn with negative/defualt values.
Reply With Quote #1

Well, i'm trying to make a new gamemode which in some moment, spawns a nemesis with 5000hp.

I don't have the code right now, but when the code executes, the nemesis(player) spawns with full health, or the nemesis(bot) spawns with negative health (ex: -15000hp).

Anybody knows what's wrong with this?

Thanks in advance.
XINLEI is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 05-08-2012 , 17:46   Re: [zp50_gamemode]Nemesis spawn with negative/defualt values.
Reply With Quote #2

Well you would need to show at least a part of the code so we can see what is the mistake maybe you didn't check something.
__________________
H.RED.ZONE is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 05-08-2012 , 20:45   Re: [zp50_gamemode]Nemesis spawn with negative/defualt values.
Reply With Quote #3

Quote:
Originally Posted by H.RED.ZONE View Post
Well you would need to show at least a part of the code so we can see what is the mistake maybe you didn't check something.
PHP Code:
public zp_fw_core_spawn_post(id)
{
    
zp_core_respawn_as_zombie(idtrue)
    
    static 
name[33]
    
    if (
random_num(1,100) < cvar_despair_nemesis_count && cvar_despair_nemesis_count get_pcvar_num(cvar_despair_ratio))
    {
        
zp_class_nemesis_set(id)
        
set_user_health(idfloatround(get_user_health(id) * get_pcvar_float(cvar_despair_nem_hp_multi)))
        
get_user_name(id,name,32)
        
        
cvar_despair_nemesis_count 0
        zp_colored_print
(0,"^x04[EXODUS]^x01 Player ^x04%s^x01 is a nemesis!",name)
    }
    else
    {
        
cvar_despair_nemesis_count++
        if (
cvar_despair_nemesis_count get_pcvar_num(cvar_despair_ratio))
            
zp_colored_print(0,"^x04[EXODUS]^x01 Chance to spawn nemesis: ^x04%d%",cvar_despair_nemesis_count)
        else
        {
            static 
text[100]
            
format(text99"^x04[EXODUS]^x01 Chance to spawn nemesis: ^x03%d%",cvar_despair_nemesis_count)
            
message_begin(MSG_ALLget_user_msgid("SayText"), _id)
            
write_byte(id)
            
write_string(text)
            
message_end()
        }
    }

This is the main edit of my gameplay, based on plague mode.

Last edited by XINLEI; 05-08-2012 at 20:48.
XINLEI is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 05-13-2012 , 21:19   Re: [zp50_gamemode]Nemesis spawn with negative/defualt values.
Reply With Quote #4

Bump.
XINLEI is offline
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 05-17-2012 , 23:22   Re: [zp50_gamemode]Nemesis spawn with negative/defualt values.
Reply With Quote #5

In your zp50_class_nemesis file, replace:

PHP Code:
public zp_fw_core_infect_post(idattacker)
{
    
// Apply Nemesis attributes?
    
if (!flag_get(g_IsNemesisid))
        return;
    
    
// Health
    
if (get_pcvar_num(cvar_nemesis_health) == 0)
    {
        if (
is_user_bot(id))
            
set_user_health(idget_pcvar_num(cvar_nemesis_base_health) * GetAliveCount() - 15000)
        else
            
set_user_health(idget_pcvar_num(cvar_nemesis_base_health) * GetAliveCount())
    }
    else
    {
        if (
is_user_bot(id))
            
set_user_health(idget_pcvar_num(cvar_nemesis_health) - 15000)
        else
            
set_user_health(idget_pcvar_num(cvar_nemesis_health))
        
    }
    
    
// Gravity
    
set_user_gravity(idget_pcvar_float(cvar_nemesis_gravity))
    
    
// Speed
    
cs_set_player_maxspeed_auto(idget_pcvar_float(cvar_nemesis_speed))
    
    
// Apply nemesis player model
    
new player_model[PLAYERMODEL_MAX_LENGTH]
    
ArrayGetString(g_models_nemesis_playerrandom_num(0ArraySize(g_models_nemesis_player) - 1), player_modelcharsmax(player_model))
    
cs_set_player_model(idplayer_model)
    
    
// Apply nemesis claw model
    
new model[MODEL_MAX_LENGTH]
    
ArrayGetString(g_models_nemesis_clawrandom_num(0ArraySize(g_models_nemesis_claw) - 1), modelcharsmax(model))
    
cs_set_player_view_model(idCSW_KNIFEmodel)    
    
    
// Nemesis glow
    
if (get_pcvar_num(cvar_nemesis_glow))
        
set_user_rendering(idkRenderFxGlowShell25500kRenderNormal25)
    
    
// Nemesis aura task
    
if (get_pcvar_num(cvar_nemesis_aura))
        
set_task(0.1"nemesis_aura"id+TASK_AURA__"b")

Just replace 15000 with whatever you want to take away health wise. Or you can do amount to be reduced by players connected:

set_user_health(id, get_pcvar_num(cvar_nemesis_base_health) * GetAliveCount() - (AMT TO REDUCE PER PERSON * GetAliveCount()))

Hope I helped.
Y060N is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 05-18-2012 , 00:00   Re: [zp50_gamemode]Nemesis spawn with negative/defualt values.
Reply With Quote #6

Quote:
Originally Posted by Y060N View Post
In your zp50_class_nemesis file, replace:

PHP Code:
public zp_fw_core_infect_post(idattacker)
{
    
// Apply Nemesis attributes?
    
if (!flag_get(g_IsNemesisid))
        return;
    
    
// Health
    
if (get_pcvar_num(cvar_nemesis_health) == 0)
    {
        if (
is_user_bot(id))
            
set_user_health(idget_pcvar_num(cvar_nemesis_base_health) * GetAliveCount() - 15000)
        else
            
set_user_health(idget_pcvar_num(cvar_nemesis_base_health) * GetAliveCount())
    }
    else
    {
        if (
is_user_bot(id))
            
set_user_health(idget_pcvar_num(cvar_nemesis_health) - 15000)
        else
            
set_user_health(idget_pcvar_num(cvar_nemesis_health))
        
    }
    
    
// Gravity
    
set_user_gravity(idget_pcvar_float(cvar_nemesis_gravity))
    
    
// Speed
    
cs_set_player_maxspeed_auto(idget_pcvar_float(cvar_nemesis_speed))
    
    
// Apply nemesis player model
    
new player_model[PLAYERMODEL_MAX_LENGTH]
    
ArrayGetString(g_models_nemesis_playerrandom_num(0ArraySize(g_models_nemesis_player) - 1), player_modelcharsmax(player_model))
    
cs_set_player_model(idplayer_model)
    
    
// Apply nemesis claw model
    
new model[MODEL_MAX_LENGTH]
    
ArrayGetString(g_models_nemesis_clawrandom_num(0ArraySize(g_models_nemesis_claw) - 1), modelcharsmax(model))
    
cs_set_player_view_model(idCSW_KNIFEmodel)    
    
    
// Nemesis glow
    
if (get_pcvar_num(cvar_nemesis_glow))
        
set_user_rendering(idkRenderFxGlowShell25500kRenderNormal25)
    
    
// Nemesis aura task
    
if (get_pcvar_num(cvar_nemesis_aura))
        
set_task(0.1"nemesis_aura"id+TASK_AURA__"b")

Just replace 15000 with whatever you want to take away health wise. Or you can do amount to be reduced by players connected:

set_user_health(id, get_pcvar_num(cvar_nemesis_base_health) * GetAliveCount() - (AMT TO REDUCE PER PERSON * GetAliveCount()))

Hope I helped.
If i do that, it'll affect the nemesis class in all the gamemodes, and i don't want that.

Is there a way to spawn somebody as nemesis better than this one?

Last edited by XINLEI; 05-18-2012 at 00:00.
XINLEI is offline
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 05-18-2012 , 00:18   Re: [zp50_gamemode]Nemesis spawn with negative/defualt values.
Reply With Quote #7

You can check what game mode it is when he spawns, and use and if statement there

I do this with the custom skills my nemesis has, so he does not have skills in Armageddon Remix.

if (zp_gamemodes_get_current() != zp_gamemodes_get_id("Armageddon"))
{
}
else
{
}

Last edited by Y060N; 05-18-2012 at 00:18.
Y060N is offline
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 22:17.


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