ID:140648
 
Code:
                if(usr.class == "Wizard"&&usr.gotflamebolt == 1)
usr.verbs += /mob/Wizard/verb/Flame_Bolt


Problem description:

This is frustrating me to no end...whenever I try to add this coding into the login system so the MOB gets this specific verb back upon login, it only comes back sometimes, not everytime. Is there any problem in this code that is doing this? Please, help, for there are other pieces of coding exactly like this doing the exact same thing.
Bump.
Try
                if(usr.class == "Wizard" && usr.gotflamebolt)
usr.verbs += /mob/Wizard/verb/Flame_Bolt
Need to see the whole proc, and how you are calling it.

(though feel free to simply exclude large chunks of copypasta code, if you can just show one line and say they're all the same)
In response to Xorbah
mob
proc
load()
if(!src)
return
if(src.joe)
return
if(fexists("players/[usr.key]"))
var/savefile/load
load = new ("players/[usr.key]")
load["mob"] >> usr
if(!usr)return
load["x"] >> usr.x
load["y"] >> usr.y
load["z"] >> usr.z
world<<"<b>[usr] has logged on to the server."
usr.joe = 1
if(usr.staff_summon)
if(usr.race == "Wizard"||usr.race == "Cleric"||usr.race == "Dark Wizard")
if(usr.stype == "Fire"||usr.stype=="Ice")
usr.instaffmode = 1
else
usr.verbs += /mob/Wizardry/verb/Staff_Summon
if(usr.race == "Doll User")
usr.verbs += /mob/Doll_User/verb/Summon_Doll
if(usr.race == "Wizard"&&usr.gotflamebolt == 1)
usr.verbs += /mob/Wizard/verb/Flame_Bolt
if(usr.Team != "One")
if(usr.status == "Head Wizard")
usr.verbs += typesof(/mob/Head_Wizard/verb)
usr.verbs += typesof(/mob/Headwizard_Commands/verb)
usr.verbs += typesof(/mob/Rank/verb/GiveWizard)
if(usr.status == "Wizard Co-Head")
usr.verbs += /mob/Wizard_CoHead/verb/Wizard_Boot
usr.verbs += /mob/Wizard_CoHead/verb/Wizard_Announce
usr.verbs += typesof(/mob/Wizard_Verbs/verb)
if(usr.status == "Member")
usr.verbs += typesof(/mob/Wizard_Verbs/verb)
else
usr.verbs += typesof(/mob/Wizard_Verbs/verb)
<dm>


Also, I log in twice. What's up with that?
In response to Xorbah
First, you close DM tags with </DM>. Second, the issue is that you are creating two mobs. The proper way to do saving/loading is like so:

client
New()
if(fexists("[key].save"))
var/savefile/F = new("[key].save")
F >> mob
..()
Del()
var/savefile/F = new("[key].save")
F << mob

mob
Write(var/savefile/F)
..()
//any special processing that needs to be done for writing, IE:
F["x"] << x
F["y"] << y
F["z"] << z
Read(var/savefile/F)
..()
//complement to whatever is in Write()
loc = locate(F["x"], F["y"], F["z"])


The line F >> anything will create an entirely new mob, and then results in you logging in to THAT mob, which is causing errors with the way you are doing things. So, you just need to load the savefile BEFORE a mob is created. Why would you want to create a mob you aren't going to use, anyway?

Next, you need to stop using usr in procs. It's wrong.

Oh, and you should also realize that client/New() and client/Del() are what are called when somebody connects and disconnects. mob/Login() and mob/Logout() are called when a client takes control / loses control of a mob, which is not quite the same.
In response to Garthor
Thank you for the help..but...mind helping me, one last time?

Login.dm:23:error:F :duplicate definition
Login.dm:19:error:F :previous definition
Login.dm:32:error:var/savefile/F:undefined var
Login.dm:895:error:usr.load:undefined proc
Login.dm:36:error::invalid expression

Why is it saying it's a duplicate and previous definition.
In response to Xorbah
Because you made a mistake.
In response to Garthor
This is quite apparent, but I don't know how it's saying it's duplicate. Please help me, I'm super rusty on coding, I haven't coded since I was 12, and i'm 16 now. Please help me, thanks in advance.
In response to Xorbah
In response to Garthor
Good one...but, seriously Garthor, is it because of Indentation problems?
In response to Xorbah
Show me the code now after you changed it from what Garthor said.
In response to Kokomo0020
client
New()
if(src.key == "Guest")
del src
..()
if(fexists("[key].save"))
var/savefile/F = new("[key].save")
F >> mob
..()
client
Del()
var/savefile/F = new("[key].save")
F << mob

mob
Write(var/savefile/F)
..()
//any special processing that needs to be done for writing, IE:
F["x"] << x
F["y"] << y
F["z"] << z
Read(var/savefile/F)
..()
//complement to whatever is in Write()
loc = locate(F["x"], F["y"], F["z"])<dm>

Login.dm:372:error:key:value not allowed here
Login.dm:372:error::empty type name (indentation error?)
Login.dm:372:error:text "[].save":value not allowed here
Login.dm:372:error::empty type name (indentation error?)
Login.dm:372:error::empty type name (indentation error?)
Login.dm:373:error:key:undefined var
Login.dm:373:error:= :expected a constant expression
Login.dm:374:error:F:duplicate definition
Login.dm:374:error:mob:duplicate definition
Login.dm:374:error:>> :instruction not allowed here
Login.dm:374:error::empty type name (indentation error?)
Login.dm:373:error::empty type name (indentation error?)
In response to Xorbah
Figure it out yourself. I'd suggest reading the Guide.