ID:262947
 
Code:
//medabot vars//
mob
var
medal=""

//Actual Medal object code
obj/Meda_Parts/Medal
icon = 'Medal.dmi'
verb
Equip()
set src in usr
if(usr.equip >= 1)
usr << "[src.name] is currently inserted.."
else
usr.medal = 'Medal.dmi'
usr.equip += 1
suffix += ""
usr << "[src.name] is inserted"

//Stat Bar//
Stat()
..()
statpanel("Meda-Watch")
stat("Medabot Name","[medabotname]")
stat("Medal","[medal]")


Problem description:
Well its for my medabots game, i am trying to show that when you insert a Medal the icon appears in the "Medal" stat bar/var. However, it does not work :/

No errors occur but when i test it in the game the "medal" stat bar shows
Medal Medal.dmi


>   Stat()
> ..()
> statpanel("Meda-Watch")
> stat("Medabot Name","[medabotname]")
> stat("Medal","[medal]")
>


var/Medal = new/obj/Meda_Parts/Medal
In response to A.T.H.K
A.T.H.K wrote:
> >     Stat()
> > ..()
> > statpanel("Meda-Watch")
> > stat("Medabot Name","[medabotname]")
> > stat("Medal","[medal]")
> >

> var/medal = new/obj/Meda_Parts/Medal
>
>


Nope i got this error
loading Medabots Online.dme
Vars.dm:83:medal :warning: variable defined but not used
loading Map.dmp
saving Medabots Online.dmb (DEBUG mode)

Medabots Online.dmb - 0 errors, 1 warning (double-click on an error to jump to it)
In response to Fire Dynasty
can someone help please....
In response to Fire Dynasty
I did it wrong lol it was 3am :(
> > >   Stat()
> > > ..()
> > > statpanel("Meda-Watch")
> > > stat("Medabot Name","[medabotname]")
> > > stat("",medal)
> > >

> > var/medal = new/obj/Meda_Parts/Medal
> >
> >
In response to A.T.H.K
A.T.H.K wrote:
I did it wrong lol it was 3am :(
> > > >     Stat()
> > > > ..()
> > > > statpanel("Meda-Watch")
> > > > stat("Medabot Name","[medabotname]")
> > > > stat("",medal)
> > > >

> > > //this is were the error is
var/medal = new/obj/Meda_Parts/Medal
> > >
> > >
//Var List
medal=""
medabotname="Not Available"


still deos not not work, errors:
loading Medabots Online.dme
Vars.dm:83:medal :warning: variable defined but not used
loading Map.dmp
saving Medabots Online.dmb (DEBUG mode)
In response to Fire Dynasty
That "error" basically meansyou have a useless var, such as:
var
A
B
C

while(1)
world<<A++
b+=232
sleep(10)


Note that var/C was not used (assuming this is all of the coding), thus it will give the "variable defined but not used" error... just delete that variable or something

Remember, codes that people post up are usually not meant to be copy/pasted but to be learned from

- GhostAnime
In response to GhostAnime
what are you talking about...i only copied the codes that are related to the problem.

i fixed the problem.....god knows how i did it XD i just played around with the code >_<
In response to Fire Dynasty
You Had to vars the same... var/medal=""
and var/medal = new/obj/medal......
In response to A.T.H.K
nope you wrong =P i did this, and it works fine.
//medabot vars//
medal=0

Stat()
..()
statpanel("Meda-Watch")
stat("Medabot Name","[medabotname]")
stat("Medal",medal)

//the medal object
usr.medal += new/obj/Meda_Parts/Medal
In response to Fire Dynasty
Acutally im right in not wrong you just found another way around it..