ID:146076
 
Code:
mob/verb/Space()
set hidden=1
if(AM<=0)
if(contents.Find(/obj/ammo/))
contents-=/obj/ammo/
AM+=20
AmmoPoints(usr)
usr<<"Reloaded."


Problem description:
the if(contents.Find(/obj/ammo/)) doesnt work >_>, it always returns 0
This might not help, but try this:

mob/verb/Space()
set hidden=1
var/A = /obj/ammo
if(AM<=0)
if(contents.Find(A))
contents-=A
AM+=20
AmmoPoints(usr)
usr<<"Reloaded."
I don't really know if this would help, but it is worth a try, isn't it?
You need usr.contents there, same for the rest of the vars.

O-matic
In response to Lotho
mob/verb/Space()
set hidden=1
var/A = /obj/ammo
if(usr.AM<=0)
if(usr.contents.Find(A))
usr.contents-=A
usr.AM+=20
usr.AmmoPoints(usr)
usr<<"Reloaded."


Still aint workin =P
In response to Xeronage
mob/verb/Space()
set hidden=1
var/obj/A = /obj/ammo/ // I assume that'll work.. :|
if(usr.AM<=0)
if(usr.contents.Find(A))
usr.contents-=A
usr.AM+=20
usr.AmmoPoints(usr)
usr<<"Reloaded."



O-matic
In response to O-matic
Still Doesn't work >_> still gives 0 at the find no matter if i have it

obj/ammo
icon='Object.dmi'
icon_state="ammo"
name="Cheap Ammo"
damage=1
suffix = "Gives you 20 ammunition."
verb/Pick_up()
set name = "Pick-up"
set src in oview(1)
usr.contents += src
In response to Xeronage
mob/verb/Space()
set hidden=1
var/obj/A = /obj/ammo/
if(usr.AM<=0)
if ((locate(A) in usr))
usr.contents-=A
usr.AM+=20
usr.AmmoPoints(usr)
usr<<"Reloaded."


That's an other way of doing it, it should work.

O-matic



mob/verb/Space()
set hidden=1
var/obj/A=locate(/obj/ammo/)in src
if(AM<=0) if(A)
del(A)
AM+=20
AmmoPoints(src)
src<<"Reloaded."


It's not required to use src in there, but I use it whenever I am allowed to.
In response to O-matic
runtime error: cannot remove from list
proc name: Space (/mob/verb/Space)
usr: SSJ4 Compufreak (/mob/player)
src: SSJ4 Compufreak (/mob/player)
call stack:

the thing with the Find Ammo is fixed