new command hasprimary, little updates

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7189 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2013-02-13 10:26:34 +00:00
parent 205e76aa15
commit 20adf12951
4 changed files with 10 additions and 6 deletions
+3
View File
@@ -737,6 +737,9 @@ docargument [P] [subpath (optional)] [] [0];
docident [getmap] [Retrieves the last map that was sent to the server using 'sendmap'.];
docident [gndtoggle] [Toggles between your primary weapon and grenades. (must be binded to a key)];
docident [grenades] [Switches to grenades. (if available) (must be binded to a key)];
docident [hasprimary] [Determines if the local player (you) are currently carrying a primary weapon.];
docremark [Returns 0 (false) or 1 (true).];
docexample [add2bind MOUSE1 [ if (hasprimary) [ echo you attacked with a primary weapon ] ]] [Everytime you press the left mouse button, assuming you are carrying your primary weapon, the above echo will be executed.];
docident [hidecustomskins] [];
docargument [B] [] [min 0/max 1/default 0];
docident [hitsound] [Plays a sound upon every successful hit if enabled.];
+4 -4
View File
@@ -15,10 +15,10 @@ newmenu Weapons
menumdl weapons/assault/menu mapmodel 75 12
menuitem [MTP-57 Assault Rifle] [ nextprimary 6; echo MTP-57 Assault Rifle selected ] [ chmenumdl Weapons weapons/assault/menu mapmodel 75 12 ]
menuitem [A-ARD/10 Submachine Gun] [ nextprimary 4; echo A-ARD/10 Submachine Gun selected ] [ chmenumdl Weapons weapons/subgun/menu mapmodel 75 12 ]
menuitem [Precision Tech AD-81 Sniper Rifle] [ nextprimary 5;echo Precision Tech AD-81 Sniper Rifle selected ] [ chmenumdl Weapons weapons/sniper/menu mapmodel 75 12 ]
menuitem [V-19 Combat Shotgun] [ nextprimary 3;echo V-19 Combat Shotgun selected ] [ chmenumdl Weapons weapons/shotgun/menu mapmodel 75 12 ]
menuitem [TMP-M&A Carbine] [ nextprimary 2;echo TMP-M&A Carbine selected ] [ chmenumdl Weapons weapons/carbine/menu mapmodel 75 12 ]
// menuitem [Combat Pistol] [ nextprimary 7;echo Combat Pistol selected ] [ chmenumdl Weapons weapons/cpistol/menu mapmodel 75 12 ]
menuitem [Precision Tech AD-81 Sniper Rifle] [ nextprimary 5; echo Precision Tech AD-81 Sniper Rifle selected ] [ chmenumdl Weapons weapons/sniper/menu mapmodel 75 12 ]
menuitem [V-19 Combat Shotgun] [ nextprimary 3; echo V-19 Combat Shotgun selected ] [ chmenumdl Weapons weapons/shotgun/menu mapmodel 75 12 ]
menuitem [TMP-M&A Carbine] [ nextprimary 2; echo TMP-M&A Carbine selected ] [ chmenumdl Weapons weapons/carbine/menu mapmodel 75 12 ]
// menuitem [Combat Pistol] [ nextprimary 7; echo Combat Pistol selected ] [ chmenumdl Weapons weapons/cpistol/menu mapmodel 75 12 ]
newmenu CLA
+2 -1
View File
@@ -140,8 +140,9 @@ loop k 10 [ const (at [green blue yellow red gray white dbrown dred purple orang
// echo (purple -1) - returns 8
// Weapon switching/action utilities.
const hasprimary [ if (= (curweapon) (currentprimary)) [ result 1 ] [ result 0 ] ]
const primary [ weapon (currentprimary) ]
const ptoggle [ if (= (currentprimary) (curweapon)) [ $arg1 ] [ primary ] ] // Toggle between primary/specified weapon
const ptoggle [ if (hasprimary) $arg1 primary ] // Toggle between primary/specified weapon
const secondary [ weapon $PISTOL ]
const sndtoggle [ ptoggle secondary ]
const melee [ weapon $KNIFE ]
+1 -1
View File
@@ -32,7 +32,7 @@ const survival [
checkinit onKill [ // Use onKill for enemies killed counter and other stats
if $startedSurvival [ //
if (&& (= $arg1 (player1 cn)) (!= $arg1 $arg2)) [ // Player1 was actor and was not suicide
+= survKills 1 // Increment enemies killed counter
++ survKills // Increment enemies killed counter
if (! (listlen $survTimeBetKills)) [ // First kill
survTimeBetKills = (- (millis) $startSurvMillis) //
] [ add2list survTimeBetKills (- (millis) $survLastKill) ] // Other kills