Sniper server??? lua???


(zbzero) #1

Anyone know a way to disables all weapons include FG42 and leave only granade, sniper rifles and knife enable at NQ???
I try many things and i think maybe will be possible do it by lua, but im not so good at it, maybe someone can point me to the right direction to get it working!!!

Thx in advance!!!


(Smoke) #2

nq_War
Description
Enable and configure war mode(s) in No Quarter.
Parameters
Type: bitmask
1 Enable War Mode: spawn with a few possible weapons but plenty of ammo
4 Enable knives
8 Enable panzers
16 Enable sniper rifles
32 Enable grenades
64 Enable riflenades
128 Enable flamethrowers
256 Enable shotguns
512 Enable poison needles
1024 Enable smoke grenades
2048 Enable binoculars
4096 Enable pliers

Default: 0


(zbzero) #3

Thanks for that but i have already checked it at noquarter wiki page!!! if i use nq_War 17 in options is already possible to see the sten and fg42 enable as a secondary weapon in limbo menu, im asking for a way to have them blocked for be choosen!!


(phisherman) #4

This can be done with lua. If you select a weapon in limbo menu, a command like this is sent: “/team <team> <class> <primaryweapon> <secondaryweapon>”. I’m not quite sure about the syntax, you might want to check this again. Now it’s easy to block all calls you don’t like. Do the same with /class, but it might use a different syntax.

If you need help or example code, let me know.


(zbzero) #5

i tought it was already done by someone but i cant find any script like that to block it in lua, i have checked some scripts i have stored here and i find in combinedfixes.lua a part something like that where prevent the sten exploit (zoom like in sniper), but i cant figure out how it works!!!
Phisherman Phriend if you can provide me some exemple i will be much grateful!!!


(phisherman) #6

I just messed around a bit and found it impossible to spawn with any weapon else than Scoped M1 Garand/Scoped K43. What NQ version do you use and are you sure you can spawn with a Sten if nq_war flag 16 is set?


(zbzero) #7

i see wathever weapon you choose you spawn with scoped garand or k43 but in the limbo menu is not blocked to be choosed the fg42 and sten, and some guys have report they want to choose these weapons (i dont know why) and they cant, im trying to block it to not have ppls complain about the weapons!! Thx for your help for that i tought it was more easy or someone have something to block it, i not will spend more time for a server i just provide for some player where i not play!!
Thanks for your help Phisherman!!!


(phisherman) #8

Ok, now it becomes clear. Unfortunately, there is now way to edit the weapon cards (the fields with the weapons on them in limbo menu) without changing game code. Tell your people it’s sniper war and they can’t spawn with anything else than a sniper rifle. Anything else is impossible, with nq_war as much as with lua.


(schnoog) #9

After taking a look over BoonDocks TJMod ( http://wolfwiki.anime.net/index.php/User:Eft-BoonDock#Change_amount_of_ammunition ) I would bet there is a way to do this. At least you could “steal” the ammo from any other weapon than the one you want to force the player to use.



-- all classes
WP_LUGER                =  2  -- Luger
WP_COLT                 =  7  -- Colt
WP_AKIMBO_LUGER         = 38  -- Akimbo Luger
WP_AKIMBO_COLT          = 37  -- Akimbo Colt
WP_MP40                 =  3  -- MP40
WP_THOMPSON			=  8	-- Thompson
WP_GRENADE_LAUNCHER     =  4  -- Axis Grenades
WP_GRENADE_PINEAPPLE    =  9  -- Allies Grenade

-- soldier
WP_PANZERFAUST          =  5  -- Panzerfaust
WP_FLAMETHROWER         =  6  -- Flamethrower
WP_MORTAR               = 35  -- Mortar
WP_MOBILE_MG42          = 31  -- Mobile MG42

-- medic
WP_MEDIC_SYRINGE        = 11  -- Syringe / Adrenaline
WP_MEDKIT               = 19  -- Medi Pack

-- engineer
WP_KAR98                = 23  -- Axis Engi Rifle
WP_GPG40                = 39  -- Axis Rifle Nade
WP_CARBINE              = 24  -- Allies Engi Rifle
WP_M7                   = 40  -- Allies Rifle Nade
WP_PLIERS               = 21  -- Pliers
WP_DYNAMITE             = 15  -- Dynamite
WP_LANDMINE             = 26  -- Landmine

-- fieldops
WP_AMMO                 = 12  -- Ammo Pack
WP_SMOKE_MARKER         = 22  -- Airstrike

-- covertops
WP_STEN                 = 10  -- Sten
WP_FG42                 = 33  -- FG42
WP_K43                  = 32  -- Axis Covert Rifle
WP_GARAND               = 25  -- Allies Covert Rifle
WP_SATCHEL              = 27  -- Satchel Charge
WP_SMOKE_BOMB           = 30  -- Smoke
et.gentity_set(clientNum, "ps.ammoclip", 10, 0)
et.gentity_set(clientNum, "ps.ammo", 10, 0)

The last 2 lines changing the ammo of sten (entity ID = 10, see above) to zero.


(Indloon) #10

Tought ETpro LUA modules are little diffrent than NoQuarter has??


(schnoog) #11

I don`t know nq very well.
NQ-wiki says:

No Quarter’s Lua API (the Interface for communication between Lua and NQ) follows mostly the ETPub-Implementation, which itself is build to be compatible with ETPro’s Lua-implementation. Therefore, all scripts written in ETpro’s documentation should be valid and more or less compatible with No Quarter’s Lua API.

and since a weapon-list is available, there should be no big problem to solve this: http://preview.tinyurl.com/3uhpbmf <- sorry for this, but this forum don`t like the nq url :slight_smile: