PDA

View Full Version : Mortal Kombat Trilogy AGGRESSOR mode and bar


axelnieves2012
12-17-2014, 01:53
Welcome to Mortal Kombat Trilogy's AGGRESSOR mode. (Working)


******************************
[REQUERIMENTS]
******************************

1) AMX ModX 1.8.2
2) Metamod v1.21-am 2013-03-15 (5:13)

******************************
[CONSOLE COMMANDS]
******************************

agg_now (void)
Game cheat. Turns you into AGGRESSOR instantly. sv_cheats ON required.

*******************************
[PLUGIN CVARS]
*******************************

agg_enabled "1"
Sets AGGRESSOR mode on/off (1=on / 0=off).

agg_time "35"
Ammount of seconds each player keeps in AGGRESSOR mode. Default: 35

agg_warning_time "7"
Ammount of seconds each player keeps in AGGRESSOR mode. Default: 7

agg_friendly "0"
If set to 1, lets you fill AGGRESSOR bar by hitting/killing team-mates.

agg_kill_percent "2"
Percent filled by killing an enemy (using primary o secundary weapon).

agg_knife_kill_percent "10"
Percent filled by killing using knife.

agg_nade_kill_percent "17"
Percent filled by killing using grenade.

agg_headshot_percent "15"
Percent filled by headshoting (no kill needed). If you use poor weapons (like pistols or SMG) you could get more percent by headshoting (because poor weapons needs more than one headshot for killing the same guy).

agg_knife_damage_percent "11"
Percent filled if you hit someone using knife (primary and secondary attacks worth the same percent).

agg_damage_percent "2"
Percent filled by shooting arms, legs, chest, stomach (using primary or secondary weapon).

greenfade_enabled "1"
Little green flash on killing an enemy (1=on / 0=off). This feature is not affected by "aggressor_enabled" cvar.

show_kills "1"
Show consecutive kills/deaths counter. This feature is not affected by "aggressor_enabled" cvar.

* * * * * * * * * * * * * * * * * * * * * * * * * *
----------------------------------------------------------------------------
[DESCRIPTION]

This plugin simulates Mortal Kombat Trilogy's AGGRESSOR.
As you shoot an enemy, your aggressor bar will increase.

It is not based on damage given, it is based on asserted shoots, so if you want to become AGGRESSOR faster, you should use poor weapons (as um45, mp5navy, pistols). Grenades increases aggressor bar too.

There are no team-mates restrictions. By default you shall not fill AGGRESSOR bar by attacking team-mates, buy you can enable this by setting "aggressor_friendly" to 1.

AGGRESSOR mode gives you total immunity (god mode) for specified time (default time is 40 seconds), which you can use to knife-kill your enemies.
God mode means that you can't take damage from explosions, bullets, fall, etc (you still can use "kill" console command.

You can recognize players that are aggressors because they gets covered on white energy shield.
Aggressors won't get additional speed because vulnerable players only can escape from them.

This plugin is customizable, edit your "csdm_aggressor.cfg" file.
It is located in "/cstrike/addons/amxmodx/configs/".
If it does not exists, it will be created on server creating. If it doesn't, uncheck all "read only" box from all these directories and check windows permissions.

Have fun!

Screenshots:
http://s23.************/e4uzewjrf/de_inferno0000.gif

http://s23.************/v82co5pu3/de_inferno0001.gif

http://s1.************/tha57hmq7/de_inferno0002.gif

http://s7.************/877jl0k5n/de_inferno0003.gif

http://s8.************/xrrxdm3yd/de_inferno0004.gif

http://s27.************/euul2dl77/de_inferno0006.gif

http://s22.************/y0ez75sr5/de_inferno0007.gif

ANTICHRISTUS
12-17-2014, 03:21
It was tested on CSDM 2.1.1 version. I didn't tested on other versions (CSDM 2.1.2 doesn't work on my server).the versions you are talking about are outdated. try the other beta versions made by Arkshine and KWo.

edit: please read the submission rules and remove the .amxx file.

smdlateef
12-17-2014, 03:29
but it would be good if it supported to 2.1.2

Arkshine
12-17-2014, 06:54
Removed AMXX file. You are not allowed to attach compiled plugin.

I don't see the point to put CSDM 2.1.1 as requirement, as later version should work too. You should simply mention it requires CSDM.
You forget to mention about the "autoexecconfig" include.

axelnieves2012
12-17-2014, 18:37
Removed AMXX file. You are not allowed to attach compiled plugin.

I don't see the point to put CSDM 2.1.1 as requirement, as later version should work too. You should simply mention it requires CSDM.
You forget to mention about the "autoexecconfig" include.

Hello, i have edited my plugin to make it work without CSDM now. I removed amxx file and I uploaded *.inc file

axelnieves2012
12-19-2014, 00:34
but it would be good if it supported to 2.1.2

nOW IT is supported. No CSDM required. We shall to wait till an admin make compiling possible. (It doesn't compile because included library not available in alliedmods server)

HamletEagle
12-19-2014, 08:21
Why you "cache" cvar values in prethink ? Why you need to get them 120 times per second * player number ?
If you really want to save their values do that in plugin_cfg( to let other plugins or amxx.cfg alter them ) and in new round event. Or use Cvar util module by arkshine and hook directly any changes.

When you loop all players use get_players, if you do it in your way you will get all possible indexes that may come from valid players.
fromatex() is faster than format(). But, if you want to format in the same buffer from where you get values you need to use format().

In instant_aggressor you create the sv_cheats variable and use it just one time, lol, use get_pcvar_num into the if.
When dealing with string arrays you should use charsmax, instead of hardcoding it's size.

Arkshine
12-19-2014, 09:22
Admin assistance required for compiling (download .amxx file). The plugin is ready and waiting for you, admins :wink: We need you include *.inc file to make compiling possible. Thanks

autoexecconfig.inc is just one stock, it's kind of overkill to use it. It would make sense to include it in your code, so your plugin doesn't rely on custom includes. At least I would do that.

axelnieves2012
12-19-2014, 21:20
Why you "cache" cvar values in prethink ? Why you need to get them 120 times per second * player number ?
If you really want to save their values do that in plugin_cfg( to let other plugins or amxx.cfg alter them ) and in new round event. Or use Cvar util module by arkshine and hook directly any changes.

When you loop all players use get_players, if you do it in your way you will get all possible indexes that may come from valid players.
fromatex() is faster than format(). But, if you want to format in the same buffer from where you get values you need to use format().

In instant_aggressor you create the sv_cheats variable and use it just one time, lol, use get_pcvar_num into the if.
When dealing with string arrays you should use charsmax, instead of hardcoding it's size.

cvar values are stored in prethink for realtime checking. If any cvar is set after round start, it will take effect inmediatelly. I dont want to save their values once. I want realtime update, i dont want to wait for new round.

cvar util by akshine does not work at all! I already tried it out. It calls undefined functions (which are defined in .inc file, but it still returns "undefined function")

I don't create/alter sv_cheats anyway. I get its current value in "instant_aggressor".

axelnieves2012
12-21-2014, 22:11
Well, i have re-written all my code and now it is more understandable, stable and optimized.
Changes:
I replaced format() by formatex().
I included autoexecconfig into source code.
I replaced cvars by pcvars.
I deleted playerprethink for realtime variable checking.
I replaced old large cvar names (csdm_aggressor_*) by short names (agg_*).
Added some new features.

Tell me if something else is needed