ID:140786
 
Code:
mob
gm
verb
jail(m as mob in world)
m.Jail()
return
proc
Jail()
src.loc=locate(5,5,2)
src.jtime=100
src.icon='jailed.dmi'
if(src.jtime<=0)
src.loc=locate(2,2,1)
src.icon='dude.dmi'
else
sleep(10)
src.jtime-=1

im not sure if it matters but it says that this operation has not affect here...(its just a warning)
                    src.Jail()


Problem description:

okay well as a few of you have asked, the problem says that Jail() was not defined, also i added all the tabs after gm and it didnt help any matters
One problem is most likely indentation, indent everything after gm.
Your second problem is the way your looping it you lose 1 second every time but gain 100 every time you loop it.
So your basically making the variable go up 99 each time. I think you'd better off using for().
You've failed to tell us what's going wrong with what you've provided here, but I'm going to take a guess and say that your problem is most likely caused by the way you put the verbs as default mob verbs.

Also, it'd be easier to loop through all the clients in the world and use their mobs rather than every mob in the world without checking to see if they're even players (clients).


mob
gm
verb
jail()
var/E[] // list of players
for(var/client/C in world)
E += C.mob // add the client's mob to E

var/mob/Target=input("Who do you wish to jail?") as null|anything in E
if(Target)
Target.Jail()
proc
Jail()
// and so on.
In response to Duelmaster409
Duelmaster409 wrote:
You've failed to tell us what's going wrong with what you've provided here, but I'm going to take a guess and say that your problem is most likely caused by the way you put the verbs as default mob verbs.

Also, it'd be easier to loop through all the clients in the world and use their mobs rather than every mob in the world without checking to see if they're even players (clients).


> mob
> gm
> verb
> jail()
> var/E[] // list of players
> for(var/client/C in world)
> C.mob += E // add the client's mob to E

Aren't you suppose to do E += C.mob?, I'm probably wrong though.
>                   
> var/mob/Target=input("Who do you wish to jail?") as null|anything in E
> if(Target)
> Target.Jail()
> proc
> Jail()
> // and so on.
>
In response to Megelic
Yes, he made a mistake.
In response to Megelic
Woops. A bit of backward-action there. Fixed.