HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simple jass question :(

03-06-2007, 06:05 AM#1
botanic
ok well I need to get the string to say "has been killed for an additional (x amount) of gold

this is what i tried but it doesn't work... please help im still learning.

Collapse JASS:
constant function AssistanceSystem_DeathMessage takes nothing returns string
    return "has been killed for an additional " + ( ( GetHeroLevel(GetDyingUnit()) * 5 ) + 100 ) + " gold "
endfunction
03-06-2007, 06:56 AM#2
diablo-dk
you are using an integer in the string, meaning you will have to convert it by using I2S(GetHeroLevel bla bla bla...)
03-06-2007, 08:12 AM#3
The)TideHunter(
Yes, hes right, use this instead:

Collapse JASS:
constant function AssistanceSystem_DeathMessage takes nothing returns string
    return "has been killed for an additional " + I2S(GetHeroLevel(GetDyingUnit())*5+100)+" gold "
endfunction

You had some pointless brackets in there, * is calculated before +. So its the same without the brackets.
03-06-2007, 10:27 AM#4
Toink
Collapse JASS:
constant function AssistanceSystem_DeathMessage takes nothing returns string
    return "was taken to school for an additional " + I2S(GetHeroLevel(GetDyingUnit())*5+100)+" gold "
endfunction