Making my Counter-Strike game, i couldnt get my reload to work... i made a overlay for my deagle. But what i cant do is make a verb to make it flick the urs's reload icon wile at the same time flick the dealge reload icon too. i tried making a w(weapon) var and when i clicked the reload verb the deagle would flick the reload for the deagle I.E:
mob/verb/Reload()
set src in usr.contents
usr.w=1
obj/deagle
icon = 'guns.dmi'
icon_state = "deagle"
layer = 5
density = 1
if(usr.w==1)
flick("deagle_r",src)
that dosent work... i dont know what to do, i am stuck. I need this reload verb to work. The problem is i dont know what operation to do is there a special way to do what i want to do? If so plz help me AIM: BAS Err0r
Err0r-
ID:149052
Jul 18 2002, 8:36 am
|
|
mob/verb/Reload()
set src in usr.contents var/obj/deagle/D flick("deagle_r",D) usr.w=1 obj/deagle icon = 'guns.dmi' icon_state = "deagle" layer = 5 density = 1 |
In response to Lummox JR
|
|
Lummox JR, so what should i do now? that code that, that other guy gave me dosent work.. Sorry if i am being a pain in the ***. Hehe, by the way a deagle is pistol...
|
In response to Err0r
|
|
it should work.
|
In response to Err0r
|
|
Err0r wrote:
Lummox JR, so what should i do now? that code that, that other guy gave me dosent work.. Sorry if i am being a pain in the ***. Hehe, by the way a deagle is pistol... ShadowSiientx's code is closer to correct, but not totally correct. This in itself is something of an achievement, though. The problem in his code is these two lines: var/obj/deagle/D Since he never said what D was, D would be null; what you really want to use there is src, as in your original code; the only catch is that it has to be put in the right place. Another problem you may be having is that in your original code, you gave the reload verb to the mob but told it "set src in usr.contents"--which is a contradiction. This set src line should be in a verb belonging to the object. obj/deagle Lummox JR |
In response to ShadowSiientx
|
|
ShadowSiientx wrote:
it should work. It won't, because you left in one of his errors and introduced a new one of your own. Lummox JR |
I don't know what a deagle is supposed to be, but the problem is in those last two lines. You've got an if() statement used outside of a proc. This is bound to have DM throwing fits and refusing to compile. This kind of thing needs to be in a proc, not listed among the vars.
Lummox JR