AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   [ZP] Last human is survivor (https://forums.alliedmods.net/showthread.php?t=86296)

miccino9408 02-23-2009 15:15

[ZP] Last human is survivor
 
In zombie_plague40.sma search:

PHP Code:

if (!g_lasthuman[id]) fm_set_user_health(idpev(idpev_health)+get_pcvar_num(cvar_humanlasthp)) 

And put

PHP Code:

set_hudmessage(2020255HUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
new 
name[32]
get_user_name(idname31)
show_hudmessage(0"%s is the last human!"name)
humanme(id1

Simple :P

Edit:
You have to put
Quote:

zp_respawn_after_last_human 0

filo 02-24-2009 11:48

Re: [ZP] Last human is survivor
 
WaW I've looking for this for so long :D

AfteR. 02-24-2009 11:51

Re: [ZP] Last human is survivor
 
what happens if zp_deathmatch is set to 3 ? T_T

miccino9408 02-24-2009 13:48

Re: [ZP] Last human is survivor
 
Oh, I forget
You have to put:
Quote:

zp_respawn_after_last_human 0
-------------------------------------------------------
Quote:

Originally Posted by filo (Post 768078)
WaW I've looking for this for so long :D

:D

filo 02-25-2009 13:42

Re: [ZP] Last human is survivor
 
Quote:

Originally Posted by AfteR. (Post 768082)
what happens if zp_deathmatch is set to 3 ? T_T

If you want zp_deathmatch to 3 you can't use this, so simple :?

lionel_lo 02-25-2009 13:47

Re: [ZP] Last human is survivor
 
Who can tell me How to turn off the survivors of unlimited Clip Ammo??

THX!!

filo 02-26-2009 18:28

Re: [ZP] Last human is survivor
 
@miccino9408 What possibilty there are to make play a sound where there is a single human left??
Quote:

Originally Posted by lionel_lo (Post 768878)
Who can tell me How to turn off the survivors of unlimited Clip Ammo??

THX!!

I found this:
Code:

/*================================================================================
 [Message Hooks]
=================================================================================*/

// Current Weapon info
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
   
    // Get weapon id
    static weapon
    weapon = get_msg_arg_int(2)
   
    // Store weapon id for reference
    g_currentweapon[msg_entity] = weapon
   
    // Replace weapon models with custom ones
    replace_models(msg_entity)
   
    // Unlimited Clip Ammo?
    if (MAXBPAMMO[weapon] > 2 && (g_survivor[msg_entity] || get_pcvar_num(cvar_infammo) > 1))
    {
        // Refill when it's running out
        if (get_msg_arg_int(3) < 7)
        {
            // Get weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
           
            // Max out clip ammo
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
       
        // HUD should show full clip all the time
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
    }
}

// BP Ammo update
public message_ammo_x(msg_id, msg_dest, msg_entity)
{
    // Get ammo type
    static type
    type = get_msg_arg_int(1)
   
    // Unknown ammo type
    if (type >= sizeof AMMOWEAPON) return;
   
    // Get weapon id
    static weapon
    weapon = AMMOWEAPON[type]
   
    // Primary and secondary only
    if (MAXBPAMMO[weapon] > 2)
    {
        // Get ammo amount
        static amount
        amount = get_msg_arg_int(2)
       
        // Unlimited BP Ammo?
        if (g_survivor[msg_entity] || get_pcvar_num(cvar_infammo))
        {
            if (amount < MAXBPAMMO[weapon])
            {
                fm_set_user_bpammo(msg_entity, weapon, MAXBPAMMO[weapon])
                set_msg_arg_int(2, get_msg_argtype(2), MAXBPAMMO[weapon])
            }
        }
        // Bots automatically buy ammo when needed
        else if (!g_zombie[msg_entity] && !g_survivor[msg_entity] && g_ammopacks[msg_entity] > 0 && amount <= BUYAMMO[weapon] && is_user_bot(msg_entity))
            clcmd_buyammo(msg_entity);
    }
}

I Added this:

Code:

/*================================================================================
 [Message Hooks]
=================================================================================*/

// Current Weapon info
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
   
    // Get weapon id
    static weapon
    weapon = get_msg_arg_int(2)
   
    // Store weapon id for reference
    g_currentweapon[msg_entity] = weapon
   
    // Replace weapon models with custom ones
    replace_models(msg_entity)
   
    // Unlimited Clip Ammo?
    if (MAXBPAMMO[weapon] > 2 && (!g_survivor[msg_entity] || get_pcvar_num(cvar_infammo) > 1))
    {
        // Refill when it's running out
        if (get_msg_arg_int(3) < 7)
        {
            // Get weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
           
            // Max out clip ammo
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
       
        // HUD should show full clip all the time
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
    }
}

// BP Ammo update
public message_ammo_x(msg_id, msg_dest, msg_entity)
{
    // Get ammo type
    static type
    type = get_msg_arg_int(1)
   
    // Unknown ammo type
    if (type >= sizeof AMMOWEAPON) return;
   
    // Get weapon id
    static weapon
    weapon = AMMOWEAPON[type]
   
    // Primary and secondary only
    if (MAXBPAMMO[weapon] > 2)
    {
        // Get ammo amount
        static amount
        amount = get_msg_arg_int(2)
       
        // Unlimited BP Ammo?
        if (!g_survivor[msg_entity] || get_pcvar_num(cvar_infammo))
        {
            if (amount < MAXBPAMMO[weapon])
            {
                fm_set_user_bpammo(msg_entity, weapon, MAXBPAMMO[weapon])
                set_msg_arg_int(2, get_msg_argtype(2), MAXBPAMMO[weapon])
            }
        }
        // Bots automatically buy ammo when needed
        else if (!g_zombie[msg_entity] && !g_survivor[msg_entity] && g_ammopacks[msg_entity] > 0 && amount <= BUYAMMO[weapon] && is_user_bot(msg_entity))
            clcmd_buyammo(msg_entity);
    }
}

And the Survivor has not Unlimited ammo anymore, but he can't buy anymore so at this line delete the ! from g_survivor
Code:

        // Bots automatically buy ammo when needed
        else if (!g_zombie[msg_entity] && !g_survivor[msg_entity] && g_ammopacks[msg_entity] > 0 && amount <= BUYAMMO[weapon] && is_user_bot(msg_entity))
            clcmd_buyammo(msg_entity);
    }

So the Bots can buy more ammo when survivor, but i dont know how to enable to player buy ammo as survivor.

lionel_lo 02-26-2009 20:41

Re: [ZP] Last human is survivor
 
Quote:

Originally Posted by filo (Post 769845)
@miccino9408 What possibilty there are to make play a sound where there is a single human left??


I found this:
Code:

/*================================================================================
 [Message Hooks]
=================================================================================*/
 
// Current Weapon info
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
 
    // Get weapon id
    static weapon
    weapon = get_msg_arg_int(2)
 
    // Store weapon id for reference
    g_currentweapon[msg_entity] = weapon
 
    // Replace weapon models with custom ones
    replace_models(msg_entity)
 
    // Unlimited Clip Ammo?
    if (MAXBPAMMO[weapon] > 2 && (g_survivor[msg_entity] || get_pcvar_num(cvar_infammo) > 1))
    {
        // Refill when it's running out
        if (get_msg_arg_int(3) < 7)
        {
            // Get weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
 
            // Max out clip ammo
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
 
        // HUD should show full clip all the time
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
    }
}
 
// BP Ammo update
public message_ammo_x(msg_id, msg_dest, msg_entity)
{
    // Get ammo type
    static type
    type = get_msg_arg_int(1)
 
    // Unknown ammo type
    if (type >= sizeof AMMOWEAPON) return;
 
    // Get weapon id
    static weapon
    weapon = AMMOWEAPON[type]
 
    // Primary and secondary only
    if (MAXBPAMMO[weapon] > 2)
    {
        // Get ammo amount
        static amount
        amount = get_msg_arg_int(2)
 
        // Unlimited BP Ammo?
        if (g_survivor[msg_entity] || get_pcvar_num(cvar_infammo))
        {
            if (amount < MAXBPAMMO[weapon])
            {
                fm_set_user_bpammo(msg_entity, weapon, MAXBPAMMO[weapon])
                set_msg_arg_int(2, get_msg_argtype(2), MAXBPAMMO[weapon])
            }
        }
        // Bots automatically buy ammo when needed
        else if (!g_zombie[msg_entity] && !g_survivor[msg_entity] && g_ammopacks[msg_entity] > 0 && amount <= BUYAMMO[weapon] && is_user_bot(msg_entity))
            clcmd_buyammo(msg_entity);
    }
}

I Added this:

Code:

/*================================================================================
 [Message Hooks]
=================================================================================*/
 
// Current Weapon info
public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
    // Player not alive or not an active weapon
    if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
 
    // Get weapon id
    static weapon
    weapon = get_msg_arg_int(2)
 
    // Store weapon id for reference
    g_currentweapon[msg_entity] = weapon
 
    // Replace weapon models with custom ones
    replace_models(msg_entity)
 
    // Unlimited Clip Ammo?
    if (MAXBPAMMO[weapon] > 2 && (!g_survivor[msg_entity] || get_pcvar_num(cvar_infammo) > 1))
    {
        // Refill when it's running out
        if (get_msg_arg_int(3) < 7)
        {
            // Get weapon entity
            static wname[32], weapon_ent
            get_weaponname(weapon, wname, sizeof wname - 1)
            weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)
 
            // Max out clip ammo
            fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
        }
 
        // HUD should show full clip all the time
        set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
    }
}
 
// BP Ammo update
public message_ammo_x(msg_id, msg_dest, msg_entity)
{
    // Get ammo type
    static type
    type = get_msg_arg_int(1)
 
    // Unknown ammo type
    if (type >= sizeof AMMOWEAPON) return;
 
    // Get weapon id
    static weapon
    weapon = AMMOWEAPON[type]
 
    // Primary and secondary only
    if (MAXBPAMMO[weapon] > 2)
    {
        // Get ammo amount
        static amount
        amount = get_msg_arg_int(2)
 
        // Unlimited BP Ammo?
        if (!g_survivor[msg_entity] || get_pcvar_num(cvar_infammo))
        {
            if (amount < MAXBPAMMO[weapon])
            {
                fm_set_user_bpammo(msg_entity, weapon, MAXBPAMMO[weapon])
                set_msg_arg_int(2, get_msg_argtype(2), MAXBPAMMO[weapon])
            }
        }
        // Bots automatically buy ammo when needed
        else if (!g_zombie[msg_entity] && !g_survivor[msg_entity] && g_ammopacks[msg_entity] > 0 && amount <= BUYAMMO[weapon] && is_user_bot(msg_entity))
            clcmd_buyammo(msg_entity);
    }
}

And the Survivor has not Unlimited ammo anymore, but he can't buy anymore so at this line delete the ! from g_survivor
Code:

        // Bots automatically buy ammo when needed
        else if (!g_zombie[msg_entity] && !g_survivor[msg_entity] && g_ammopacks[msg_entity] > 0 && amount <= BUYAMMO[weapon] && is_user_bot(msg_entity))
            clcmd_buyammo(msg_entity);
    }

So the Bots can buy more ammo when survivor, but i dont know how to enable to player buy ammo as survivor.

This amendment will be unlimited bullets for each person

filo 02-27-2009 09:47

Re: [ZP] Last human is survivor
 
Quote:

Originally Posted by lionel_lo (Post 769922)
This amendment will be unlimited bullets for each person

LOL xD Only Tested Being Survivor xD

water 02-28-2009 12:20

Re: [ZP] Last human is survivor
 
Quote:

Originally Posted by miccino9408 (Post 767558)
In zombie_plague40.sma search:

PHP Code:

if (!g_lasthuman[id]) fm_set_user_health(idpev(idpev_health)+get_pcvar_num(cvar_humanlasthp)) 

And put

PHP Code:

set_hudmessage(2020255HUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
new 
name[32]
get_user_name(idname31)
show_hudmessage(0"%s is the last human!"name)
humanme(id1

Simple :P

Edit:
You have to put

i don't know what to do. can you post the code together?


All times are GMT -4. The time now is 16:57.

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