ID:140917
 
Code:
mob
proc
projectile(obj/projectile,var/dir,var/delay)
sleep(1)
walk(projectile,dir)
sleep(delay)
del(projectile)
obj
bow
name = "Bow"
icon = 'bow.dmi'
worn = 0//its 0 if you are NOT wearing the shoes
verb
Wear()//you wear the shirt
if(src.worn == 1)//if you are already wearing it
src:worn = 0//you unwear it
usr.overlays -= 'bow.dmi'//and it dissapears from your icon
usr << "You reMove the [src.name]."//and tells you the message
bow = 0
else//or if you are not wearing it
src:worn = 1//you wear it

usr.overlays += 'bow.dmi'//it appears on your icon
usr << "You wear the [src.name]."//and tells the message
bow=1
Drop()
if(src.worn)
usr << "Not while its being worn."
if(!src.worn)
src.loc=locate(usr.x,usr.y-1,usr.z)
Get()

set src in oview(1)
src.loc = usr
usr<<"You picked up [src]"
Shoot()
if(src.inquiver<=0)
usr<<"not enough arrows"
if(src.arrow==0)
usr<<"get some arrows"
if(src.arrow>=0)
if(src.inquiver>=0)
usr.projectile(new/obj/arrowfly(usr.loc),usr.dir,40)
src.inquiver-=1
..()
else
return
obj
arrowfly
icon = 'flying.dmi'
Arrows
name = "arrows"
icon = 'arrows.dmi'
worn = 0//its 0 if you are NOT wearing the shoes
verb
Drop()
if(src.worn)
usr << "Not while its being worn."
if(!src.worn)
src.loc=locate(usr.x,usr.y-1,usr.z)
Get()

set src in oview(1)
src.loc = usr
usr<<"You picked up [src]"
src.arrow = 1
obj
var
worn = 0
bow=0
arrow=0
inquiver=100
turf
grass
icon='g.dmi'
mob
Login()
icon = 'mob.dmi'
..()
mob
Stat()
statpanel("Player")
stat("--------")
stat("Inventory:",src.contents)
stat("--------")
..()


Problem description:


it shoots the arrow regardless if i have any arrows in my inventory

also, its not showing that i have a bow, or arrows, in my inventory


help please
if(src.arrow>=0) //I'm assuming this is the number of arrows you have.

The >= operator means "greater than OR EQUAL TO". Change it to just "greater than (>)."
In response to Kaiochao
inquiver is how many arrows you have, arrow is 'do you have arrows equipt'
mob
proc
projectile(obj/projectile,var/dir,var/delay)
sleep(1)
walk(projectile,dir)
sleep(delay) // only after this sleep goes through...
del(projectile)

if(src.inquiver>=0)
usr.projectile(new/obj/arrowfly(usr.loc),usr.dir,40)
src.inquiver-=1 // ...this is called.

You need a spawn in there, because it's gonna make it sleep(40) before lowering the var -1

And as Kaiochao said, don't make it be able to shoot when you have 0 inquiver :/
if(src.inquiver>=0) /* -> */ if(src.inquiver>0)