ID:176273
 
statpanel("inventory",src.contents)
but how do u set the obj to src.contents:
obj
foodicon
icon = 'inventory.dmi'
name = "Food"
icon_state = "food"
obj
foodicon
icon = 'inventory.dmi'
name = "Food"
icon_state = "food"
verb/Pick_Up()
usr << "You pick up the [src]."
Move(usr)






It explains this in my RPGtutorial, I suggest you download this and it should answer many of your questions about that kind of stuff.
In response to Kunark
its not an item you can pickup/drop, its the usrs food(usr:food) like in a var. they start out with 2 food. therefor, there should be 2 icons in the inventory. How would i do that?heres the mob code:
mob
PC
icon = 'player.dmi'
Stat()
statpanel("Character",)
stat("Name: ",usr.name)
stat("Gender: ",usr.gender)
stat("Gold: ",usr:gold)
stat("Food: ",usr:food)
stat("Water: ",usr:water)
statpanel("Inventory",src.contents)
if(usr:pet1==1)
statpanel("Pet",)
stat("Name: ",usr:pet1name)
stat("Gender: ",usr:pet1gender)
stat("Condition: ",usr:pet1con)
stat("Hunger: ",usr:pet1hun)
var
gold = 100
food = 2
water = 1
pet1 = 0
pet1name
pet1gender
pet
pet1con = "Fine"
pet1connum = 0
pet1hun = "Full"
pet1hunnum = 0
pet1ths = "Ok"
pet1thsnum = 0
In response to KitKate20
in your char creating coding make it so those items go in the inventory/usr
In response to Koolguy900095
char cheating coding? what? im making an online game! you think im trying to cheat someones game?!
In response to KitKate20
i meant creating....wasnt it obvious?
In response to Koolguy900095
o. sorry. well anyway, im not sure how to do this, and im really confused @_@
In response to KitKate20
at the login put like:

var/mob/food/cheese/ = new(usr)//just edit the path to where the stuff is
In response to Koolguy900095
hold on, you mean like:
if("Little Boy")
character = new /mob/LittleBoy()
var/obj/foodicon/foodicon/ = new(usr)
like that? warning:
variable defined but not used.....
In response to KitKate20
KitKate20 wrote:
its not an item you can pickup/drop, its the usrs food(usr:food) like in a var. they start out with 2 food. therefor, there should be 2 icons in the inventory. How would i do that?heres the mob code:
mob
PC
icon = 'player.dmi'
Stat()
statpanel("Character",)
stat("Name: ",usr.name)
stat("Gender: ",usr.gender)
stat("Gold: ",usr:gold)
stat("Food: ",usr:food)
stat("Water: ",usr:water)
statpanel("Inventory",src.contents)
if(usr:pet1==1)
statpanel("Pet",)
stat("Name: ",usr:pet1name)
stat("Gender: ",usr:pet1gender)
stat("Condition: ",usr:pet1con)
stat("Hunger: ",usr:pet1hun)
var
gold = 100
food = 2
water = 1
pet1 = 0
pet1name
pet1gender
pet
pet1con = "Fine"
pet1connum = 0
pet1hun = "Full"
pet1hunnum = 0
pet1ths = "Ok"
pet1thsnum = 0



I'm not quite sure what you mean by that, but if it is what I *think* you mean, I guess you could try this:

obj/Foodobj
icon = 'food.dmi'
name = "Food"
Click()
if(usr.food > 0)
usr << "Mmm, that was tasty!"
usr.food--
else
usr << "You don't have anymore food!"
var/obj/Foodobj/FoodClickable = new

Stat()
statpanel("Character",)
stat("Name: ",usr.name)
stat("Gender: ",usr.gender)
stat("Gold: ",usr:gold)
stat("Food: ",usr:food)
stat("Water: ",usr:water)
statpanel("Inventory",src.contents)
stat("----FOOD----")
var/F = usr.food
while(F)
stat(FoodClickable)
F--

if(usr:pet1==1)
statpanel("Pet",)
stat("Name: ",usr:pet1name)
stat("Gender: ",usr:pet1gender)
stat("Condition: ",usr:pet1con)
stat("Hunger: ",usr:pet1hun)