New native aliases: onKill & onTK

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6292 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-04-21 11:23:48 +00:00
parent fff3e2c977
commit 0bd871cf02
3 changed files with 26 additions and 2 deletions
+2
View File
@@ -514,6 +514,8 @@ docident [onDeathOther] [If this alias exists it will be run every time anybody
docident [onDeathSelf] [If this alias exists it will be run every time you yourself die.];
docident [onSpawnOther] [If this alias exists it will be run every time anybody but yourself spawns.];
docident [onSpawnSelf] [If this alias exists it will be run every time you yourself spawn.];
docident [onKill] [If this alias exists it will be run every time you kill an enemy.];
docident [onTK] [If this alias exists it will be run every time you kill a teammate.];
docident [mdldyncache] [];
docargument [V] [] [min 1/max 32/default 2];
docident [mdlstatcache] [];
+14
View File
@@ -1432,6 +1432,20 @@ addOnLoadAlways [
<identifierReference identifier="onCallVote"/>
</references>
</scriptalias>
<scriptalias name="onKill">
<description>If this alias exists it will be run every time you kill an enemy.</description>
<references>
<identifierReference identifier="onTK"/>
</references>
</scriptalias>
<scriptalias name="onTK">
<description>If this alias exists it will be run every time you kill a teammate.</description>
<references>
<identifierReference identifier="onTK"/>
</references>
</scriptalias>
<scriptalias name="add2alias">
<description>This will append the passed 2nd argument to any existing content of the alias named in the 1st argument. Several popular aliases have predefined shortcuts using this scriptalias: addOnQuit, addOnLoadOnce, addOnLoadAlways. Check config/scripts.cfg for possible omissions in that list.</description>
+10 -2
View File
@@ -770,12 +770,20 @@ void dokill(playerent *pl, playerent *act, bool gib, int gun)
else if(isteam(pl->team, act->team))
{
if(pl==player1) outf("\f2you were %s by teammate %s", death, aname);
else outf("%s%s %s teammate %s", act==player1 ? "\f3" : "\f2", aname, death, pname);
else
{
outf("%s%s %s teammate %s", act==player1 ? "\f3" : "\f2", aname, death, pname);
if(identexists("onTK")) execute("onTK");
}
}
else
{
if(pl==player1) outf("\f2you were %s by %s", death, aname);
else outf("\f2%s %s %s", aname, death, pname);
else
{
outf("\f2%s %s %s", aname, death, pname);
if(identexists("onKill")) execute("onKill");
}
}
if(gib)