Raised This Month: $51 Target: $400
 12% 

Suggestion / Subplugin Request Block antidote (after last human)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 07-21-2015 , 16:46   Block antidote (after last human)
Reply With Quote #1

Hello everyone, im need simple code which blocks/disable antidote for zombies after last human. Im using ZP 4.3 (easy modified).

Im need change this:

Code:
// Last human
		if (g_isalive[id] && !g_zombie[id] && !g_survivor[id] && fnGetHumans() == 1)
		{
			if (!g_lasthuman[id])
or this,

Code:
       case EXTRA_ANTIDOTE:
			{
				if (!get_pcvar_num(cvar_extraantidote) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit)) continue;
				formatex(buffer, charsmax(buffer), "%L", id, "MENU_EXTRA2")
And add (antidote) condition similar like this

Code:
case EXTRA_ANTIDOTE:
			{
				if (!get_pcvar_num(cvar_extraantidote) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit)) continue;
				formatex(buffer, charsmax(buffer), "%L", id, "MENU_EXTRA2")
				if (g_firstzombie[id])
            {
                client_print(id, print_center, "First zombie is cannot buy items!")
Everyone help me ? Im search this for long time...

Sorry for bad english.

Last edited by Laoming; 08-06-2015 at 20:47.
Laoming is offline
inlovecs
Member
Join Date: Dec 2012
Old 08-05-2015 , 07:22   Re: Block antidote (after last human)
Reply With Quote #2

You should have this in zombieplague.cfg :

// Deathmatch
// ----------
zp_deathmatch 1 // Deathmatch mode, respawn as: [0-disabled // 1-human // 2-zombie // 3-randomly // 4-balance]
zp_spawn_delay 5 // Delay before respawning on deathmatch mode in seconds
zp_spawn_protection 1 // Spawn protection time for deathmatch in seconds [0-disabled]
zp_respawn_on_suicide 0 // Respawn players if they commited suicide
zp_respawn_after_last_human 0 // Zombies can no longer buy antidotes on deathmatch when the zp_respawn_after_last_human cvar is disabled and there's only one human left
zp_infection_allow_respawn 0 // Allow respawning on infection rounds
zp_nem_allow_respawn 0 // Allow respawning on nemesis rounds
zp_surv_allow_respawn 0 // Allow respawning on survivor rounds
zp_swarm_allow_respawn 0 // Allow respawning on swarm rounds
zp_plague_allow_respawn 0 // Allow respawning on plague rounds
zp_sniper_allow_respawn 0 // Allow respawning on sniper rounds
zp_assassin_allow_respawn 0 // Allow respawning on assassin rounds
zp_respawn_zombies 0 // Whether to respawn killed zombies
zp_respawn_humans 0 // Whether to respawn killed humans
zp_respawn_nemesis 0 // Whether to respawn killed nemesis

And will be ok,dont need 1` more plugin for this.
__________________

inlovecs is offline
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 08-06-2015 , 20:46   Re: Block antidote (after last human)
Reply With Quote #3

I thought it rather as a condition, not block respawn for zombies... Im need block antidote for zombies... Not respawn.

Im need this---> When the last human alive, antidotes canot buy.
Laoming is offline
Cristi. C
Junior Member
Join Date: Jul 2014
Location: Home
Old 08-07-2015 , 09:49   Re: Block antidote (after last human)
Reply With Quote #4

For block antidote after last human

PHP Code:
new g_lasthuman_antidote_allow;

g_lasthuman_antidote_allow register_cvar"zp_lasthuman_antidote_allow""0" 
And change code
PHP Code:
                case EXTRA_ANTIDOTE:
                {
                    if (!
get_pcvar_num(cvar_extraantidote) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit)) continue;
                    
formatex(buffercharsmax(buffer), "%L"id"MENU_EXTRA2")
                } 
In
PHP Code:
                case EXTRA_ANTIDOTE:
                {
                    if (!
get_pcvar_num(cvar_extraantidote) || ( fnGetHumans() == && get_pcvar_numg_lasthuman_antidote_allow ) ) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit)) continue;
                    
formatex(buffercharsmax(buffer), "%L"id"MENU_EXTRA2")
                } 
__________________
Contact with me
Skype: cristi.c94
SteamID: http://steamcommunity.com/id/crististefan94/
Cristi. C is offline
Send a message via Skype™ to Cristi. C
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 08-07-2015 , 17:42   Re: Block antidote (after last human)
Reply With Quote #5

Thanks for help, but not working. What is wrong?

Register :
Code:
// Game vars
new g_pluginenabled // ZP enabled
new g_newround // new round starting
new g_endround // round ended
new g_nemround // nemesis round
new g_survround // survivor round
new g_swarmround // swarm round
new g_plagueround // plague round
new g_modestarted // mode fully started
new g_lastmode // last played mode
new g_scorezombies, g_scorehumans // team scores
new g_spawnCount, g_spawnCount2 // available spawn points counter
new Float:g_spawns[MAX_CSDM_SPAWNS][3], Float:g_spawns2[MAX_CSDM_SPAWNS][3] // spawn points data
new g_lights_i // lightning current lights counter
new g_lights_cycle[32] // current lightning cycle
new g_lights_cycle_len // lightning cycle length
new Float:g_models_targettime // for adding delays between Model Change messages
new Float:g_teams_targettime // for adding delays between Team Change messages
new g_MsgSync, g_MsgSync2 // message sync objects
new g_trailSpr, g_exploSpr, g_flameSpr, g_smokeSpr, g_glassSpr // grenade sprites
new g_modname[32] // for formatting the mod name
new g_freezetime // whether CS's freeze time is on
new g_maxplayers // max players counter
new g_czero // whether we are running on a CZ server
new g_hamczbots // whether ham forwards are registered for CZ bots
new g_fwSpawn, g_fwPrecacheSound // spawn and precache sound forward handles
new g_infbombcounter, g_antidotecounter, g_madnesscounter // to limit buying some items
new g_arrays_created // to prevent stuff from being registered before initializing arrays
new g_lastplayerleaving // flag for whenever a player leaves and another takes his place
new g_switchingteam // flag for whenever a player's team change emessage is sent
new g_lasthuman_antidote_allow //last human  <-------
Condition :
Code:
case EXTRA_ANTIDOTE:
			{
				if (!get_pcvar_num(cvar_extraantidote) || ( fnGetHumans() == 1 && get_pcvar_num( g_lasthuman_antidote_allow ) ) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit)) continue;
				formatex(buffer, charsmax(buffer), "%L", id, "MENU_EXTRA2")
				if (g_firstzombie[id])
            {
                client_print(id, print_center, "First zombie cannot buy items!")
And still not work. Why?
Laoming is offline
Cristi. C
Junior Member
Join Date: Jul 2014
Location: Home
Old 08-08-2015 , 00:19   Re: Block antidote (after last human)
Reply With Quote #6

And add cvar

PHP Code:
g_lasthuman_antidote_allow register_cvar"zp_lasthuman_antidote_allow""0" 
zp_lasthuman_antidote_allow 0 // Off

zp_lasthuman_antidote_allow 1 // on
__________________
Contact with me
Skype: cristi.c94
SteamID: http://steamcommunity.com/id/crististefan94/

Last edited by Cristi. C; 08-08-2015 at 00:19.
Cristi. C is offline
Send a message via Skype™ to Cristi. C
Old 08-08-2015, 08:44
Laoming
This message has been deleted by Laoming. Reason: Removed SMA file...(edited módě)
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-09-2015 , 23:05   Re: Block antidote (after last human)
Reply With Quote #7

Code:
if (!get_pcvar_num(cvar_extraantidote) || g_antidotecounter >= get_pcvar_num(cvar_antidotelimit) || zp_get_human_count() == 1) continue;
sorry but i dont know how to count humans inside zp 4.3 source code, you will have to find that out by the native i gave you...
you should better use zp 5.0... is easier to customize, this thing would of taken 10 seconds to be done

Last edited by Depresie; 08-09-2015 at 23:13.
Depresie is offline
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 08-11-2015 , 18:13   Re: Block antidote (after last human)
Reply With Quote #8

Im never using ZP 5.0 or higher, but ZP 4.3 is good because many plugins work with this version. Im looking for code or cvar (last human) to this version....Unfortunately I have not found :/
Laoming is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-11-2015 , 22:23   Re: Block antidote (after last human)
Reply With Quote #9

all plugins from zp 4.3 are working on zp 5.0
also, zp 5.0 has a cvar for what you need
Depresie is offline
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 08-19-2015 , 21:11   Re: Block antidote (after last human)
Reply With Quote #10

Do nobody knows? Many players on my server got rage when the lasthuman and someone use antidote

Last edited by Laoming; 08-19-2015 at 21:12.
Laoming 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 02:27.


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