AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Zombie Class: Rage Zombie [v1.5] (https://forums.alliedmods.net/showthread.php?t=146852)

Excalibur.007 01-02-2011 05:10

[ZP] Zombie Class: Rage Zombie [v1.5]
 
2 Attachment(s)
Features:
Code:

- Give health
- Set max speed
- Glow, aura & trail
- Damage multiplier
- Simple cooldown/duration system with color/colour chat

CVars:
Code:

zp_rage_duration "8.0" - How long it will last
zp_rage_cooldown "25.0" - Cooldown time before using it again
zp_rage_rgb "255 0 0 16" - Glow, aura and trail when raged
zp_rage_radius "20" - Radius of aura
zp_rage_maxspeed "300.0" - Sets the maxspeed when raged
zp_rage_addhealth "300" - Amount of health will be added when raged
zp_rage_dmgmultiplier "2.0" - Damage multiplier when raged
zp_rage_painshockfree "1" - Enable/disables pain shock free when raged
zp_rage_trailbrightness "255" - Trail brightness
zp_rage_trailsize "5" - Trail width
zp_rage_traillife "2" - Trail life (The higher it is, the longer the trail)

Let's explain the zp_rage_rgb format.

The format is:
Code:

zp_rage_rgb "RRR GGG BBB AAA"
Which is also, RED GREEN BLUE ALPHA

Changing the prefix of color/colour print
PHP Code:

#define CHAT_PREFIX    "[ZP]" 

It's on top of the codes.

Changelogs:
Code:

1.0 - Initial release
1.1 - Fixed print colour bug
    - Fix the spam
1.2 - Damage multiplier not working
    - Added CVar to enable/disable pain shock free during raged
1.3 - Fix glow not working
    - Added a loop for setting glow just incase his rendering gets reset
1.4 - Woops, something useless spotted
1.5 - Optimizations
    - Bug fix, if the zombie turns into human, glow, etc is still taking effect

Credits:
louistds - Lollerskaters rush to me and report the bugs (Fixed in 1.1)
abdul_rehman - Optimizations :D

Questions:
Why not +use?
http://forums.alliedmods.net/showpos...73&postcount=9

File removed. Checking bugs. Doesn't seem to works


[IMG]http://img291.**************/img291/9931/dedust20000qi.jpg[/IMG]

[IMG]http://img819.**************/img819/1999/dedust20001k.jpg[/IMG]

ardi 01-02-2011 05:32

Re: [ZP] Zombie Class: Rage Zombie
 
Thank you very much, but i have question, when is standing close to human its taking him HP? And can you remove the button witch is needed to start raging, i want it automaticly when you choose it stat raging.
And how can i change the glow in green?
Thanks Again !

Excalibur.007 01-02-2011 05:38

Re: [ZP] Zombie Class: Rage Zombie
 
Ah, this is a different version. For the glow, 0 255 0 16

ardi 01-02-2011 05:49

Re: [ZP] Zombie Class: Rage Zombie [v1.0]
 
would u remake it for me :S? i want it to be radioactive when standing close to human it takes him HP but it stops on 25hp and doesent kill them and the glow of rage never stops, i saw the plugin is giving HP, you are good scripter atm, so i'm please man.

Excalibur.007 01-02-2011 05:50

Re: [ZP] Zombie Class: Rage Zombie [v1.0]
 
I'll send you in PM once done.

ardi 01-02-2011 06:02

Re: [ZP] Zombie Class: Rage Zombie [v1.0]
 
Thank You man !

albert123 01-02-2011 07:42

Re: [ZP] Zombie Class: Rage Zombie [v1.1]
 
When does it rage ? Be attacked or i need to press a button..

abdul-rehman 01-02-2011 07:46

Re: [ZP] Zombie Class: Rage Zombie [v1.1]
 
GJ as usual :D

Excalibur.007 01-02-2011 07:51

Re: [ZP] Zombie Class: Rage Zombie [v1.1]
 
Thanks. What it does it, When you press your reload button, it will have glow, aura and trail. Max speed is increased, HP is added and damage multiplier. Quite simple.

I will look forward to see question like, why not using the +use button? Simple, some maps requires to activate buttons, maps like cs_siege. It has a life which requires to activate it via a button.

Something new in 1.2 and a bug fix

EDIT: Oh my god. I forgotten I missed the bug again. Reupdated. Sorry for double update!
EDIT2: GAH GAH GAH stupid blind me. Another update. LOL. Enough of this roflcopter.

abdul-rehman 01-02-2011 08:41

Re: [ZP] Zombie Class: Rage Zombie [v1.4]
 
Time for suggestions :)

1-
Code:
public client_putinserver(id) {     g_bConnected[id] = true }
Since you have knowledge in bits you should try to use the following method for all booleans in ur plugin bcoz it will require less memory usage, which means ur plugin will be more effecient
Code:
// Using bits will be far more effecient new g_bitConnectedPlayers // This variable will allow us to use one var only to store all connected player's indexs' #define MarkUserConnected(%0)   ( g_bitConnectedPlayers |= ( 1 << ( %0 & 31 ) ) ) #define ClearUserConnected(%0)  ( g_bitConnectedPlayers &= ~( 1 << ( %0 & 31 ) ) ) #define IsUserConnected(%0)  ( g_bitConnectedPlayers & ( 1 << ( %0 & 31 ) ) ) // Put this in thos forwards public client_connect(id) MarkUserConnected(id) public client_disconnect(id) ClearUserConnected(id) some_function( id ) {     // To check if user is connected     if ( IsUserConnected(id) )     {         // ...     } }
2- u should try to use static variables especially in FM_CmdStart

3-
Code:
public fw_PlayerPreThink(id) {     if (!g_bAlive[id] || !g_bIsRage[id] || !g_bInRage[id])         return FMRES_IGNORED         set_user_maxspeed(id, get_pcvar_float(cvar_maxspeed))         return FMRES_IGNORED }
It would be better to cache the speed cvar bcoz prethink is called very often
4-
Code:
replace_all(szMsg, 190, "!w", "^0")
I think you should remove this coz u know what it is supposed to do and it is in da wrong place :D


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

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