ID:1438422
 
Code:


Problem description:

All the code works, but I'm kinda a beginner with the DM code... Could some please help me with this
it's all messed up and I don't know what else to fix. http://pastebin.com/j3KKxGSd
What are you having a problem with?
For the love of God, read the comments carefully. I spent my time commenting some of the stuff for you to learn. And I didn't tab it for you either. So, you'll have to check that each thing is tabbed properly. This should be what you were having problems with. Good luck.

var/wininfo = "<b><font color=gray>WIN Info:</font> " // I made this to be reused easier since you use it a lot.
var/list/WINlist=list()
var/Guess_Time=1

// Removed the tmp var since nothing was assigned to it
mob/var/Number_Pick // Removed the brackets and quotations since you're randomizing ONLY a number -- Update after reading the rest of the code: Removed the entire value. You can set a random number through the WIN_Guess Verb
// The less you write, the faster your codes. Simplify it as much as possible. Even if it's simple stuff.

proc/Stat_WIN()
var/Win_Number= rand(1,5)
var/Stat_Amount= rand(100000,1000000)
world << "[wininfo]Stat Points WIN is now taking number guesses to win statpoints."
world << "[wininfo]The winners will be picked out in 4 minutes." // Grammatical error on winers
sleep(2400) // 240 seconds in 4 minutes. This is correct. However, it doesn't need to be spawned. If you want to know why, ask me in pager.
for(var/mob/player/M in WINlist) // Remember that this is "here"
if(M.client&&M.Number_Pick==Win_Number) // I haven't coded in a while. So, I don't know if M.client is the right thing to put. But, You surely need to check if they are still in the game. Otherwise, when you add the stats, you'll get a null error.
world<<"[wininfo][M] has won [Stat_Amount] statpoints."
Stat_Amount += M.statpoints
WINlist -= M // Not usr, but instead M. Because you're checking for "M" at "here"
world<<"[wininfo]Stat Points WIN has ended. The next WIN will be in 3 hours."
Guess_Time=0
spawn(108000) // You need to spawn here so that the current Stat_WIN() proc ends. Sleeping would make this wait forever pretty much since it calls itself.
Stat_WIN()



mob/verb/WIN_Guess()
set category="Commands"
if(Guess_Time==1)
for(var/mob/player/M in PlayerList)
if(src.key in WINlist) // Don't use usr all the time. Page me and I'll explain.
alert(src,"You have already picked a number","Error")
return
WINlist + = src // Are you going to add the WINlist to src.key? Switch it around. Also, instead of adding the key, add the actual player.
src.Number_Pick = rand(1,5) // Set the users guessed number to a random value of 1 - 5.
world << "[wininfo][M] has guessed the number [Number_Pick]."


Same thing but on pastebin: http://pastebin.com/X1jnRZQV
In response to MisterPerson
but the problem was the += and -= that when the code reached that poiint the whole code stoped and or canceled it self ad didnt do anything
In response to Xirre
O thanks Xirre ill take a look and try it out ad if you want ill give the cridts to you in the updates. :p
Oops. I see an error. WINlist + = src. Should be +=. No spaces between that operator. I'm sure you can fix it yourself. :) -- No credit needed. Just need you to study up on those comments and learn from your mistakes like everyone else has. That's the only thing I ask for in return.
In response to Xirre
uh if its not a bother at all the code you just did for me had little issues fixed them all it works smoothly but ould you take a look at one more small code sprite :x http://pastebin.com/LHDXxEVd
Well, for starters. You have a */ in there but no /*. So, remove the */. Secondly, from MaxPl to Defense, your indentation is wrong. That's all I'll help you with. The rest should be of your understanding of programming from what I commented for you.
I wish i had a hoster and a helper on this server then i wont have a probem and i cant host cause of my stupid internet
actually xirre the code didnt work at all it isnt working