zazo, on 30 September 2012 - 02:19 PM, said:
Hum... Is it possible to encode the reverse command of "addweapon":
for example, duke could lose a weapon in the game. ?... when the weapon is empty or a monster steals a weapon ?...
Yes. Set the relevant player struct members. For example, if the weapon lost is the chaingun (weapon 3), then you could use the following code:
setplayer[THISACTOR].gotweapon 3 0 // player no longer has the chaingun
setplayer[THISACTOR].curr_weapon 0 // sets current weapon to mighty boot
setplayer[THISACTOR].ammo_amount 3 0 // takes chaingun ammo as well (optional)
You will need to use a variable if you want the weapon taken to be the current one, rather than a certain number.