Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP] Addon: Quad Damage (Human)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-31-2011 , 14:05   [ZP] Addon: Quad Damage (Human)
Reply With Quote #1

Last night i play Quake 3 Arena with my friend and i got this idea, so i decide to create a plugin that make a similar effect in Quake 3 Arena.

Plugin Descriptions:
* On each round but not survivor round, a Quad Damage model will spawn randomly on map, so human need to pickup it to get extra damage multiplier.

Cvars:
* zp_quad_spawntime 30 -- Interval for 1 Quad Damage model spawning on map.
* zp_quad_quadtime 30 -- Quad Damage effect time.
* zp_quad_dmgmulti 5 -- Quad Damage multiplier.

Modules:
* engine
* fakemeta
* hamsandwich

Credits:
* David Anderson -- CSDM's collect spawn point.
* Quake 3 Arena -- Quad Damage sound.

Changes log:
* Code optimization, thanks to Excalibur.007.
Attached Files
File Type: zip sound.zip (34.2 KB, 2135 views)
File Type: sma Get Plugin or Get Source (ZP_Addon_QuadDmg.sma - 3575 views - 7.5 KB)
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 08-02-2011 at 03:59. Reason: Update to v1.0.1
yokomo is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-31-2011 , 18:45   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #2

Nice

PHP Code:
switch(mode)
{
    case 
MODE_INFECTIONset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)
    case 
MODE_MULTIset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)    
    case 
MODE_PLAGUEset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)
    case 
MODE_NEMESISset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)
    case 
MODE_SWARMset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)


PHP Code:
if(mode != MODE_SURVIVOR)
{
    
set_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)

Excalibur.007 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-31-2011 , 19:09   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #3

+

#1 Is this needed in zp_user_infected_post?

PHP Code:
if(!id || !infector) return 
#2 Check in TakeDamage if attacker is a player. And this also not needed !pev_valid(victim).
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 08-01-2011 , 04:50   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #4

Quote:
Originally Posted by Excalibur.007 View Post
Nice

PHP Code:
switch(mode)
{
    case 
MODE_INFECTIONset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)
    case 
MODE_MULTIset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)    
    case 
MODE_PLAGUEset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)
    case 
MODE_NEMESISset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)
    case 
MODE_SWARMset_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)


PHP Code:
if(mode != MODE_SURVIVOR)
{
    
set_task(get_pcvar_float(cvar_spawntime), "CreateQuadEntity"TASK_QUAD_SPAWN)

Oww i though switch case is faster, gonna change later.

Quote:
Originally Posted by bibu View Post
+

#1 Is this needed in zp_user_infected_post?

PHP Code:
if(!id || !infector) return 
#2 Check in TakeDamage if attacker is a player. And this also not needed !pev_valid(victim).
PHP Code:
if(!id || !infector) return 
To prevent from an error log message by new zp4.3fix5, if it not necessary i can delete it.

PHP Code:
pev_valid(victim
Checking whether player is valid or not, for me this is useful in zp4.3, it can block from taking damage by world trigger damage (asid, lava, laserbeam) before round start & after round end.

For example you can watch this simple clip:
http://www.youtube.com/watch?v=akUFdbdZky8
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-01-2011 , 05:31   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #5

Alright, but you still need to check in TakeDamage if attacker is a player.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-01-2011 , 05:37   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #6

You dont need to check if victim is player since you registered the Ham_TakeDamage with "player" entities only, also if you check pev_valid(victim) with an entity you will get the same results whether the entitiy is player or non-player.
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 08-01-2011 , 05:42   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #7

Quote:
Originally Posted by bibu View Post
Alright, but you still need to check in TakeDamage if attacker is a player.
What do you mean by that? using pev_valid(attacker)?

Quote:
Originally Posted by abdul-rehman View Post
You dont need to check if victim is player since you registered the Ham_TakeDamage with "player" entities only, also if you check pev_valid(victim) with an entity you will get the same results whether the entitiy is player or non-player.
Then how about this? http://www.youtube.com/watch?v=akUFdbdZky8 can you explain it to me?
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 08-01-2011 , 06:43   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #8

Quote:
Originally Posted by yokomo View Post
What do you mean by that? using pev_valid(attacker)?


Then how about this? http://www.youtube.com/watch?v=akUFdbdZky8 can you explain it to me?
pev_valid(entity) checks if the entity is valid or not. So just use is_user_alive(entity)

and for the (!id | !infector),
I don't think is necessary. But if it for known error log, then leave it there. I still don't find problems in ZP 4.3 Fix 5a.
Excalibur.007 is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-01-2011 , 06:59   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #9

Quote:
Originally Posted by Excalibur.007 View Post
pev_valid(entity) checks if the entity is valid or not. So just use is_user_alive(entity)

and for the (!id | !infector),
I don't think is necessary. But if it for known error log, then leave it there. I still don't find problems in ZP 4.3 Fix 5a.
You still need to add this check in zp_user_infected_post
if (!infector) return;
since sometimes the infector is set to 0 (in the case of first zombie) so if you then do something with the infector (like check its zombie class) then ZP would throw a run-time error.
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 08-01-2011 , 07:09   Re: [ZP] Addon: Quad Damage (Human)
Reply With Quote #10

Oh, didn't notice the problem :X.
Excalibur.007 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 14:38.


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