- Joined
- Mar 15, 2012
- Messages
- 2,877
Does anyone know how to do a identify player check so it doesn't create a load code .txt file for everyone?
JASS:
function CreateTextFile takes nothing returns nothing
local integer p = GetPlayerId(GetTriggerPlayer())+1
local string heroName = GetUnitName(udg_Hero)
local integer heroLevel = GetHeroLevel(udg_Hero)
call PreloadGenClear()
call PreloadGenStart()
// The line below creates the log
// Right now, this is:
// Hero: (hero name)
// Level: (hero level)
// Code: -load XXXX
call Preload("\r\n\t\t\t\tHero: " + heroName + "\r\n\t\t\t\t" + "Level: " + I2S(heroLevel) + "\t\t\r\n\t\t\t\t" + "Code: -load " + udg_NPS_Password + "\r\n\n\t\t ")
// The line below creates the file at the specified location
// Right now, this is:
// "Warcraft III\FolderName\(hero name) - (hero level)"
call PreloadGenEnd("FolderName\\" + heroName + " - " + I2S(heroLevel) + ".txt")
endfunction
- Custom script: call CreateTextFile()