ID:145118
 
Code
1.0 System\1.2 Administration\H_Admin.dm:324:error: proc definition not allowed inside another proc: // thats one error
1.0 System\1.2 Administration\H_Admin Loading and Saving.dm:68:error:banned:undefined var // second error
1.0 System\1.2 Administration\H_Admin Loading and Saving.dm:67:if :warning: if statement has no effect // third error


Problem description:

How do i fix this
In response to DivineO'peanut
okk thats alot of help..
How can i define a var that would help alot thanks you
In response to PuNkS
EXAMPLE:
mob/var/Health = 100

Then you can do something like..
mob/proc/Lose_health()
src.Health -= 5

Any questions?
In response to Gooseheaded
No thanks alot
In response to PuNkS
How about showing the damn code for these errors instead of commenting on people who always help people when you can't even get the hint?

Show the damn code that associates to these errors.
I have a feeling you haven't read the DM Guide.
This and this may help, too.
In response to DivineO'peanut
PEANUT BUTTER JELLY TIME
In response to Pyro_dragons
OK i got one error with this
  Boot_Player(mob/PC/M in world)
set category = "Admin"
if(GMLockCheck ())
usr<<" font color =red> YOur Admin Powers are locked!"
return
else
var/Reason=input("Input a reason.")as null|text
var/Time=input({"For how long? (in seconds)
(Max of 900 seconds (15 Minutes))
(Input the amount of time for boot.
Any time past 15 minutes will be lowered
to 15 minutes)"}
) as num
if(Time>=900)
Time=900
if(Time>=1)
Time*=10
if(Reason)
if(Time)
world << "<b>[M] has been <font color=red>Booted</font> by [src] ([Reason])([Time/10] Seconds)"
M.booted=1
AdminLog("Boot","[Reason]","Time: [Time/10] Seconds",M)
del(M)//**********//

M.booted is an undefined var. What i want to make is a timed boot so that i boot someone for a set time and they can only log on after that time has passed. I didnt add the part where the person logs back on if u could help with that part i would appreciate it
In response to PuNkS
Well I don't see the mob/var/booted anywhere in that code so or course its undefined. Do you not know what undefined means?

Undefined in code term : has not been set; undeclared; no value
In response to Pyro_dragons
So where would i put that code?
and i changed the mob/PC/M in world to client/M in world
and instead of M.booted i put BootK+=M.ckey
and also i added var/list/NootK and BootK = new /list.
So i got out of those errors now what would i put for the log in part?
In response to PuNkS
That's pretty bad design wise. First of all, that would be a temporary ban rather than a "timed boot", because a "timed boot" implies that someone is booted after a specified time. The other issue I have with it is that a reason is required which prevents a quick ban which may be necessary.
In response to PuNkS
OK I GOT ALL OF THAT PART FINISHED
now i have one last question
client/New()
if(key in boot)
var/Time = boot[key]
if(!Time) return
if(world.realtime > Time)
boot.Removed (key)
else
src <<"You are temporarily retricted from entering [world.name]. You can rejoin after ([Time/10] Seconds) have expired"
return
.=.. ()

I got that boot.Removed is a undefined proc.
I always get these type of errors undefined proc/var

1. Can u tell me how to correct this problem
2. Give me a link to where i could read upon how to fix these errors. Thanks
In response to PuNkS
PuNkS wrote:
1. Can u tell me how to correct this problem
2. Give me a link to where i could read upon how to fix these errors. Thanks

The way to correct this problem is to stop using other peoples code so freely.

Stop, go back to step 1, read the DM Guide and follow it. If you want, check out Zilal's tutorials, the DM Reference and the F1 menu in Dream Maker if you're doubtful about something specific.

Copy-pasting other peoples code and constantly coming to the forums to get it fixed because you don't understand basic, underlying parts of the language is NOT the way to go.

Do yourself a huge favor, and stop using copy-pasted code and write things yourself. You need a basic understanding of the language, that you simply don't have.