ID:2576044
 
(See the best response by Kaiochao.)
Code:
        NewChar1()
if(!usr.Active)
usr.Active = 1
usr.CreatePlayer1()
else
alert("Error")
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

CreatePlayer1()
if(fexists("players/[src.ckey]/[src.ckey](2).sav"))
src.DeleteChar1()
src.SlotImages()
else
src.level=1
src.SaveFile1=1
src.SaveFile3=0
src.SaveFile2=0
src.ParseName()
src.loc = locate(7,126,2)
winshow(src,"ClanSelect",1)
Interface(src.client)
src.Finished=0
src.AutoSave()

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

DeleteChar1()
switch(alert(src, "Delete Character From Slot 1? *YOUR CHARACTER WILL BE GONE!*", "Character Deletion", "Yes","No"))
if("Yes")
src<<"<font color=red>Accessing Database...</font>"
fdel("players/[src.ckey]/[src.ckey](1).sav")
src.SaveFile1=0
src<<"<font color=red>Save Deleted Successfully.</font>"
SecondScreen(src.client)
src.SlotImages()
return
else
src<<"Okay"
SecondScreen(src.client)
src.SlotImages()
return
src.Active = 0


Problem description:

Hellloo, Need help once more and as always I'm more than okay with being directed to the right place and doing the research myself.. I simply need to know where that place is x.x. So my problem though,

When you log in, you hit the create button and creation works awesome. But when I want to remake a character, the idea is that it goes through the create player process and if it detects a sav file, it's suppose to run the Deletechar() proc, however nothing happens at all D:. Thanks again for any help you are able to give =D!
If you need the “Active” var = 0 to create a new save file, you are using “return” in your delete proc. So src.Active will never be 0 as the execution will never reach that line.
Best response
CreatePlayer1 is looking for a file that ends with (2).sav, but DeleteChar1 is deleting (1).sav.

I recommend parametrizing your methods which only differ by slot number. You shouldn't have duplicate code which only differs by something that could just be a single value. Example:
NewChar(slot)
CreatePlayer(slot)
DeleteChar(slot)
// "Delete Character From Slot [slot]?"
// "players/[src.ckey]/[src.ckey]([slot]).sav"
Okay so @Tacurumin, that's why I set the "Error" alert, to make sure that wasn't the issue and I can assure you it isn't. I get no error message or anything. Just nothing :/. @Kaichao although I am very embarrassed over that oversight lol, I did correct it and still, it's not working. I'm gonna spend some times looking into your parametrizing theory and see what I can come up with. Thank you for your help guys =D.
Okay so I think I get what you're saying with the parametrizing, however the way the login works is that the interface is buttons. You click slot 1/2/3 and that's what you create from. It's not like a list or drop down menu or anything. I could definitely condense things but if that doesn't work then yes I have more efficient coding, but my proc still isn't being called to delete their character lol. I will implement it now and try it out. Hopefully it works!
In response to Kyubikitsune
Even if you are clicking 3 different buttons, you can still very quickly go from 3 interface buttons into 1 proc.

From 3 buttons to 1 verb calling 1 proc, where button 1 has command "click-slot 1", button 2 has command "click-slot 2", etc.:
client
verb/click_slot(slot as num)
NewChar(slot)

Condensing (refactoring) your code isn't about the code's efficiency. It's about making problems, like what you're currently having, much easier to find and deal with. You'll have fewer places to look and fewer places to fix.
So I did as you suggested. I do infact like it, it's much easier on the eyes and easier to navigate lol. somewhere along the line it was prompting me for deletion.. but then I messed it up again!! But now I know that it is possible I just have to find the way! If you have any other suggestions please let me know =D.
Although NewChar() is being called by a verb, it's still not wise to apply usr within it because it's a proc, and doubly so because it's a proc that will involve changing characters which will switch mobs.

For readability's sake, I'd also get rid of the src.var and src.proc() pattern in your code. src is implied unless you have a local var with that same name.