• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Creating Folder For Save Codes

Status
Not open for further replies.
Level 3
Joined
Sep 8, 2013
Messages
21
Please Help me I want to do if someone write -save create folder by name safsafa.txt and in this txt file says writer's save code helpp
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Generate the savecode by using any saveload system (for example this: http://www.wc3c.net/showthread.php?t=87360) and then call this function:

JASS:
function WriteFile takes string filename, string savecode returns nothing
	set savecode = "\r\n\r\n
Code: "+savecode+"\r\n\r\n"
	call PreloadGenClear()
	call PreloadGenStart()
	call Preload("\")
	"+savecode+"
	(\"")
	call PreloadGenEnd(filename)
endfunction

Example:
call WriteFile("\\Savecode\\code.txt", "QWERT-ZUIOP-ASDFG-HJKLY-XCVBN")
 
Last edited:
Level 3
Joined
Sep 8, 2013
Messages
21
i dont understand if i write -save in game the folder is creating already ? (sory my bad english )
it gives this error expected returns
function WriteFile takes string filename string savecode returns nothing
 
Last edited:
Level 14
Joined
Jun 27, 2008
Messages
1,325
well it has to be "function WriteFile takes string filename, string savecode returns nothing"

This function only creates the folder and the textfile, to generate the savecode you will have to use a SaveLoad system (either the one i linked or some other one). Use the search function.

And posting your questions here should suffice, no need to write me a pm and a visitor message.
 
Status
Not open for further replies.
Top