From 20adf12951e5f2ccba42d4a7e55f3562b190192d Mon Sep 17 00:00:00 2001 From: Bukz Date: Wed, 13 Feb 2013 10:26:34 +0000 Subject: [PATCH] new command hasprimary, little updates git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7189 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/docs.cfg | 3 +++ config/menus_settings.cfg | 8 ++++---- config/scripts.cfg | 3 ++- config/survival.cfg | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config/docs.cfg b/config/docs.cfg index a01be5ba..486aeb97 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -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.]; diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index 94e6c6d8..5e24e16c 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -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 diff --git a/config/scripts.cfg b/config/scripts.cfg index 71837e91..5104f439 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -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 ] diff --git a/config/survival.cfg b/config/survival.cfg index 4b7d109f..67cdf8c7 100644 --- a/config/survival.cfg +++ b/config/survival.cfg @@ -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