No mp40, granade
Posted: Tue Aug 05, 2008 11:21 pm
Hi I need Config when mp40/thompson and granade dont be allowed.
Bani's Discussion Forums
https://bani.anime.net/banimod/forums/
https://bani.anime.net/banimod/forums/viewtopic.php?f=17&t=6928
xamrex wrote:Hi I need Config when mp40/thompson and granade dont be allowed.
Code: Select all
Version = 1.2
Author = "im2good4u"
Description = "Disable Weapons\n"
--[[---------------------------------------------------[[--
Changelog:
1.1:
Made Configable
1.0:
Konwn bugs u still get a knife
initial release
--]]---------------------------------------------------]]--
--global vars
et.MAX_WEAPONS = 50
samplerate = 200
--
--note sme got no comment thats becase it arent weapons
weapons = {
nil, --// 1
true, --WP_LUGER, // 2
false, --WP_MP40, // 3
false, --WP_GRENADE_LAUNCHER, // 4
true, --WP_PANZERFAUST, // 5
true, --WP_FLAMETHROWER, // 6
true, --WP_COLT, // 7 // equivalent american weapon to german luger
false, --WP_THOMPSON, // 8 // equivalent american weapon to german mp40
false, --WP_GRENADE_PINEAPPLE, // 9
true, --WP_STEN, // 10 // silenced sten sub-machinegun
true, --WP_MEDIC_SYRINGE, // 11 // JPW NERVE -- broken out from CLASS_SPECIAL per Id request
true, --WP_AMMO, // 12 // JPW NERVE likewise
true, --WP_ARTY, // 13
true, --WP_SILENCER, // 14 // used to be sp5
true, --WP_DYNAMITE, // 15
nil, --// 16
nil, --// 17
nil, --// 18
true, --WP_MEDKIT, // 19
true, --WP_BINOCULARS, // 20
nil, --// 21
nil, --// 22
true, --WP_KAR98, // 23 // WolfXP weapons
true, --WP_CARBINE, // 24
true, --WP_GARAND, // 25
true, --WP_LANDMINE, // 26
true, --WP_SATCHEL, // 27
true, --WP_SATCHEL_DET, // 28
nil, --// 29
true, --WP_SMOKE_BOMB, // 30
true, --WP_MOBILE_MG42, // 31
true, --WP_K43, // 32
true, --WP_FG42, // 33
nil, --// 34
true, --WP_MORTAR, // 35
nil, --// 36
true, --WP_AKIMBO_COLT, // 37
true, --WP_AKIMBO_LUGER, // 38
nil, --// 39
nil, --// 40
true, --WP_SILENCED_COLT, // 41
true, --WP_GARAND_SCOPE, // 42
true, --WP_K43_SCOPE, // 43
true, --WP_FG42SCOPE, // 44
true, --WP_MORTAR_SET, // 45
true, --WP_MEDIC_ADRENALINE, // 46
true, --WP_AKIMBO_SILENCEDCOLT,// 47
true --WP_AKIMBO_SILENCEDLUGER,// 48
}
function et_InitGame(levelTime,randomSeed,restart)
maxclients = tonumber( et.trap_Cvar_Get( "sv_maxClients" ) ) --gets the maxclients
et.G_Print("[NOWEAPON] Version:".. Version .." Loaded\n")
et.RegisterModname("NoWeapon:".. Version .."slot:".. et.FindSelf())
end
function et_ClientSpawn(clientNum,revived)
for i=1,(et.MAX_WEAPONS-1),1 do
if not weapons[i] then
et.gentity_set(clientNum,"ps.ammoclip",i,0)
et.gentity_set(clientNum,"ps.ammo",i,0)
end
end
end
-- called every server frame
function et_RunFrame( levelTime )
if math.mod(levelTime, samplerate) ~= 0 then return end
-- for all clients
for j = 0, (maxclients - 1) do
for k=1, (et.MAX_WEAPONS - 1), 1 do
if not weapons[k] then
et.gentity_set(j, "ps.ammoclip", k, 0)
et.gentity_set(j, "ps.ammo", k, 0)
end
end
end
end