Raised This Month: $ Target: $400
 0% 

[ZP] Human and Zombie Remaining


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
serjaka
Senior Member
Join Date: Oct 2011
Old 11-23-2013 , 13:59   [ZP] Human and Zombie Remaining
Reply With Quote #1

Hello AlliedModders i have a problem with scripting! i want too add sniper and assassin round check! So i have this plugin:
PHP Code:
 #include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague2>

/*================================================================================
 [Constants, Offsets, Macros]
=================================================================================*/

// Plugin Version
new const PLUGIN_VERSION[] = "1.0.0"

/*================================================================================
 [Global Variables]
=================================================================================*/

// Game vars
new g_iMaxPlayers // max player counter
new g_HudSync
new g_bNemesis // Nemesis round
new g_bSurvivor // Survivor round
new g_bAssassin // Nemesis round
new g_bSniper // Survivor round

/*================================================================================
 [Init]
=================================================================================*/

public plugin_init()
{
    
register_plugin("Zombie Plague Stats"PLUGIN_VERSION"Serjaka")
    
    
RegisterHam(Ham_Killed"player""Ham_Killed_Post"1)
    
    
g_iMaxPlayers get_maxplayers()
    
    
g_HudSync CreateHudSyncObj()
}

/*================================================================================
 [Main Forwards]
=================================================================================*/

public zp_round_started(modeplayer)
{
    switch (
mode)
    {
        case 
MODE_NEMESISg_bNemesis true;
        case 
MODE_SURVIVORg_bSurvivor true;
        case 
MODE_ASSASSINg_bAssassin true;
        case 
MODE_SNIPERg_bSniper true;
    }
}


public 
Ham_Killed_Post(victimattackergib)
{
    
display_enemy_remaining()
}

public 
zp_user_humanized_post(idsurvivor)
{
    
display_enemy_remaining()
}

public 
zp_user_infected_post(idinfectornemesis)
{
    
display_enemy_remaining()

I want to add assassin and sniper round check too, i write this in code but it doesnt work (Error : you alredy difine...)
PHP Code:
 public zp_user_humanized_post(idsniper)
{
    
display_enemy_remaining()

PHP Code:
public zp_user_infected_post(idinfectorassassin)
{
    
display_enemy_remaining()

i got error too If i add
PHP Code:
 public zp_user_infected_post(idinfectorassassinnemesis
and
PHP Code:
 public zp_user_humanized_post(idsnipersurvivor
help me please to fix this ! i need for sniper and assassin round too ! THX! Sorry for my bad English!

Last edited by serjaka; 11-23-2013 at 18:17.
serjaka is offline
bat
Veteran Member
Join Date: Jul 2012
Old 11-23-2013 , 14:29   Re: [ZP] Human and Zombie Remaining
Reply With Quote #2

Test it

Code:
public display_enemy_remaining()
{
    if (g_bNemesis || g_bSurvivor || g_bAssassin || g_bSniper) return
    
    for (new i = 1; i <= g_iMaxPlayers; i++)
    {
        if (!is_user_connected(i)) continue
        if (!is_user_alive(i)) continue
        
        static message[128], zombie_count, human_count
        human_count = zp_get_human_count()
        zombie_count = zp_get_zombie_count()
        
        if (!zp_get_user_zombie(i) || !zp_get_user_nemesis(i) || !zp_get_user_assassin(i) && zombie_count)
        {
            set_hudmessage(175, 175, 175, 0.05, 0.625, 2, 0.02, 3.0, 0.01, 0.3, 2)

            format(message, 127, "%d Zombie%s Remaining...", zombie_count, (zombie_count == 1) ? "" : "s")
            ShowSyncHudMsg(i, g_HudSync, "%s", message)
        }
        else if (zp_get_user_zombie(i) || zp_get_user_survivor(i) || zp_get_user_sniper(i) && human_count)
        {
            set_hudmessage(175, 175, 175, 0.05, 0.625, 2, 0.02, 3.0, 0.01, 0.3, 2)

            format(message, 127, "%d Human%s Remaining...", human_count, (human_count == 1) ? "" : "s")
            ShowSyncHudMsg(i, g_HudSync, "%s", message)
        }
    }
}
__________________
bat is offline
Send a message via Skype™ to bat
serjaka
Senior Member
Join Date: Oct 2011
Old 11-23-2013 , 14:35   Re: [ZP] Human and Zombie Remaining
Reply With Quote #3

Dont work , i need to add this but i got error on copile
PHP Code:
  public zp_user_humanized_post(idsniper)
{
    
display_enemy_remaining()

and for assasin to

Last edited by serjaka; 11-23-2013 at 14:36.
serjaka is offline
Old 11-23-2013, 14:44
bat
This message has been deleted by bat.
bat
Veteran Member
Join Date: Jul 2012
Old 11-23-2013 , 14:52   Re: [ZP] Human and Zombie Remaining
Reply With Quote #5

Code:
public zp_user_humanized_post(id)
{
   if (!zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_sniper(id))
   {
       display_enemy_remaining()
   }
}

public zp_user_infected_post(id, infector)
{
  if (zp_get_user_zombie(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id))
  {
       display_enemy_remaining()
  }
}
__________________
bat is offline
Send a message via Skype™ to bat
serjaka
Senior Member
Join Date: Oct 2011
Old 11-23-2013 , 16:07   Re: [ZP] Human and Zombie Remaining
Reply With Quote #6

This code in both code?
PHP Code:
 zp_get_user_zombie(id

Last edited by serjaka; 11-23-2013 at 16:08.
serjaka is offline
bat
Veteran Member
Join Date: Jul 2012
Old 11-23-2013 , 16:36   Re: [ZP] Human and Zombie Remaining
Reply With Quote #7

Code:
zp_get_user_zombie
It is Zombie

Code:
!zp_get_user_zombie
It is Human
__________________
bat is offline
Send a message via Skype™ to bat
serjaka
Senior Member
Join Date: Oct 2011
Old 11-23-2013 , 18:16   Re: [ZP] Human and Zombie Remaining
Reply With Quote #8

thx works perfect
serjaka is offline
Reply


Thread Tools
Display Modes

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 23:19.


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