ok ive tried doing if(!src.loc in contents) also if(src in /turf) but neither work.
how do i make it so if a obj is on the ground (a turf) it does one thing and if its in the contents of a user does nothing? please help.
ID:271186
Feb 25 2007, 11:32 am
|
|
if(!src.loc in contents)
There's two things wrong with this...
1) Place a bracket of what you are trying to look in.. meaning if(!(src.loc in contents)) otherwise it'll think you mean if(0 in contents) (Look up the ! operator)
2) Er, why are you looking for the location of the item in it's own contents... what you are saying is if(!(src.loc in src.contents)).. so yeah... I think you want usr.contents.. assuming it's in a verb..but it would still be wrong... as the X.loc would be the reference of the atom the item is in... so:
if(!(src in usr.contents)) <-- checks if the item is not in the usr's contents
if(isturf(src.loc)) <-- checks if the item is in a turf
if(ismob(src.loc)) <-- checks if the item is in a mob
The three code above all do the same thing :|
- GhostAnime