You are not logged in.
Pages: 1
I have recently started programming some lua scripts for my nitmod server. This very basic code is intended to control ammo at spawntime:
et.gentity_set(clientNum,"ps.ammoclip",weapons[i].weapon_id, weapons[i].ammoclip)
et.gentity_set(clientNum,"ps.ammo",weapons[i].weapon_id, weapons[i].ammo)
However, nitmod seems to use entirely different fieldnames than ETpro or ETpub. This isn't really a problem, except that I don't actually know what they are. Would you mind supplying a partial list? Specifically, this script is unable to modify the akimbo ammo.
-Soak
P.S. I have a list of weapon ids already, don't need those
Offline
Mind posting your lua script in here ?
Maybe it will help us figuring out the problem
P.S.: Are you sure your Weapon ID's list is correct ? I don't remember publishing them anywhere for the moment, so where did you get them ?
Offline
I absolutely don't mind publishing it - it is currently a very simple script but I am hoping to expand it to cover most weapons:
et.NUM_WEAPONS = 2
COLT = {
weapon_id = 7,
ammoclip = 10,
ammo = 30
}
AKIMBO_LUGER = {
weapon_id = 35,
ammoclip = 2,
ammo = 2
}
weapons = {
COLT,
AKIMBO_LUGER
}
function et_InitGame(levelTime,randomSeed,restart)
et.G_Print("Custom weapon script loaded.\n")
end
function et_ClientSpawn(clientNum,revived)
for i=1,(et.NUM_WEAPONS),1 do
et.gentity_set(clientNum,"ps.ammoclip",weapons[i].weapon_id, weapons[i].ammoclip)
et.gentity_set(clientNum,"ps.ammo",weapons[i].weapon_id, weapons[i].ammo)
end
end
I have tested this on single luger and adrenaline as well, it works perfectly. As for the weapon id's - you never published it, I got em straight from the dll. Figured I'd save the trouble of asking you.
Currently when loading the script for double lugers, I get this ammo as default:
8|2|48
Only the right pistol ammo is actually being modified correctly.
Soak
Offline
Pages: 1