ID:1492256
 
(See the best response by Kaiochao.)
So, I'm trying to code a proc that I can force players to call to when they finish making a new character. The game has RNG extra's at birth and people mass remaking their character for it is an issue. I have not tested it yet but I would like to know if the following would work.

mob/proc/RemakeCheck()
var/global/Remakes.[src.key]
src << "Remakes = [++Remakes.[src.key]]"
if(Remakes.[src.key]>=4&&src.SpecialBirth)
fdel("players/[src.key].sav")
world<<"User key [src] has been wiped for mass remaking!"
del(src)
else
return


The reason I made it this way is so the counter automatically resets for everyone whenever the server is reset. Would this work(seriously doubting wheter I can make vars with a redirection in its name)? are there ways to approve on it? all help appreciated!
Best response
"Remakes.[src.key]" doesn't do what you think it does. It won't work in your example because you can't create a list with an initial length of a string.
mob
proc/RemakeCheck()
// Make a global empty list
var global/remakes[0]

// This puts 'key' in the list if it's not already there
// and then increments its associated value.
remakes[key] ++

src << "Remakes = [remakes[key]]"
if(remakes[key] >= 4 && SpecialBirth)
fdel("players/[key].sav")
world << "User key [src] has been wiped for mass remaking!"
del src

// 'return' is useless at the end of anything
// 'else return' is even more so