NP20_Ammo
icon='weapons.dmi'
icon_state="ammo"
verb/load()
var/obj/o = locate(/obj/Weapons/pistol) in usr.contents
if(!o)
alert("You do not have an NP-20")
return
o.Ammo+=30//This is my problem right here!
usr<<"<font color=teal> You add 30 rounds to your NP-20"
del src
return
That is the Ammo that you collect and load into your gun, if you have one that is.
obj/Weapons
icon = 'Weapons.dmi'
suffix = "UnEquipped"
var
BulletIcon = 'Weapons.dmi'
BulletIcon_State = ""
BulletIconRGB = list(0,0,0)
BulletDammage = 0
BulletSpeed = 2
Bulletsound=""
ShootingSpeed = 2
WeaponRange = 9
Ammo=30
tmp/IsShooting
Defining the default vars for the weapons.
obj/Weapons/pistol
name = "NP-20 9mm"
icon_state = "gun"
BulletIcon_State = "bullet"
BulletIconRGB = list(0,0,0)
BulletDammage = 10
BulletSpeed = 1
Bulletsound='np20.wma'
ShootingSpeed = 10
WeaponRange = 5
Ammo=30
That is basicly just the vars for this particular weapon.
Problem description:
I get the error : Stargate Atlantis Discovery\Objects.dm:93:error:o.Ammo:undefined var
i have tried adding the Ammo var everywhere and no luck.
Any help will be appreciated =)