Page 1 of 1

Need help finding the wrong error in the trigger

Posted: February 7th, 2018, 2:25 am
by boymotmat1989
I'm learning how to write jass, I have a new idea of changing the player's color for JJpack cheats. I have inserted it into the command line but it does not work. Can you help me correct the mistake and let me know where I am wrong. Thanks

Re: Need help finding the wrong error in the trigger

Posted: February 8th, 2018, 4:58 pm
by haxorico
next time use the {code} bracket so we can read without download. like so

Code: Select all

elseif SubString(s2s,0,11)="-changename" then
set string s = GetPlayerName(Player(zzz))
set integer i2 = StringLength(s)
set integer i3= i2/4                     
call SetPlayerName(Player(zzz),"|cffff0080"+SubString(s,0,i3)+"|cffff00ff"+SubString(s,i3,i3+2)+"|cffff80c0"+SubString(s,i3+2,i3+4)+"|cffff80ff"+SubString(s,i3+4,

anyway. you don't create variables mid function, all locals are declared at the top of the function.
also you don't change the value using the type of variable.
change "set string s" to just "set s"

Re: Need help finding the wrong error in the trigger

Posted: February 10th, 2018, 8:36 am
by boymotmat1989
thank you. I'm learning jass and my english is bad