ID:143961
 
Code:
mob/verb/Fish()
set category = "Commands
set src in oview(1)
var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents
if(Fishing_rod)
usr<<"You start fishing."
sleep(30)
if (prob(20))
usr<<"You catch a fish!"
usr.contents+=new/obj/Fish
else
usr<<"You don't catch anything."
else
usr<<"You need a Fishing rod."


Problem description:
what is wrong with this code?

Please post your errors.
*I can tell you right now, indention.
In response to Flame Sage (#1)
yes. identitation. but i um. u know found it this way in some old archives 0_0
mob/verb/Fish()
set category = "Commands
//set src in oview(1) would allow you to fish out of people next to you, which is a little silly
var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents
if(Fishing_rod)
usr<<"You start fishing."
sleep(30)
if (prob(20))
usr<<"You catch a fish!"
usr.contents+=new/obj/Fish
else
usr<<"You don't catch anything."
else
usr<<"You need a Fishing rod."


Aside from the glaring indentation errors, you had it set up so this verb would be accessible from mobs adjacent to you. If you absolutely must have a partner to fish with you, then by all means, set src in oview(1), otherwise, you're better off just cutting that line out and leaving it with the default of src = usr ;)
In response to DerDragon (#3)
DerDragon wrote:
> mob/verb/Fish()
> set category = "Commands
> //set src in oview(1) would allow you to fish out of people next to you, which is a little silly
> var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents
> if(Fishing_rod)
> usr<<"You start fishing."
> sleep(30)
> if (prob(20))
> usr<<"You catch a fish!"
> usr.contents+=new/obj/Fish
> else
> usr<<"You don't catch anything."
> else
> usr<<"You need a Fishing rod."
>


Aside from the glaring indentation errors, you had it set up so this verb would be accessible from mobs adjacent to you. If you absolutely must have a partner to fish with you, then by all means, set src in oview(1), otherwise, you're better off just cutting that line out and leaving it with the default of src = usr ;)

lolz. i just want it to be set up when im standing on water xD
In response to Gogeta126 (#4)
lolz. i just want it to be set up when im standing on water xD

Then you'd want to make it a turf/water/verb/Fish(), and set src in oview(0).
Gogeta126 wrote:
Code:
mob/verb/Fish()
> set category = "Commands
> set src in oview(1)
> var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents
> if(Fishing_rod)
> usr<<"You start fishing."
> sleep(30)
> if (prob(20))
> usr<<"You catch a fish!"
> usr.contents+=new/obj/Fish
> else
> usr<<"You don't catch anything."
> else
> usr<<"You need a Fishing rod."
>


Problem description:
what is wrong with this code?


Commands is missing a quotation mark.
In response to Shyyk (#6)
Shyyk wrote:
Gogeta126 wrote:
Code:
mob/verb/Fish()
> > set category = "Commands
> > set src in oview(1)
> > var/obj/Fishing_rod = locate(/obj/Fishing_rod) in usr.contents
> > if(Fishing_rod)
> > usr<<"You start fishing."
> > sleep(30)
> > if (prob(20))
> > usr<<"You catch a fish!"
> > usr.contents+=new/obj/Fish
> > else
> > usr<<"You don't catch anything."
> > else
> > usr<<"You need a Fishing rod."
> >


Problem description:
what is wrong with this code?


Commands is missing a quotation mark.

yea that i already noticed :P
In response to DerDragon (#5)
ok thanks done it and it works :)