HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why won't this work? (Warning: This is Jass)

03-27-2006, 11:52 PM#1
Linera
Here is the code I'm having problems with:

Collapse JASS:
//###########################################################################
constant function cs_H2I takes handle h returns integer
return h
return 0
endfunction

constant function cs_I2U takes integer i returns unit
return i
return null
endfunction

constant function cs_I2T takes integer i returns trigger
return i
return null
endfunction

constant function cs_I2TT takes integer i returns texttag
return i
return null
endfunction

constant function cs_I2It takes integer i returns item
return i
return null
endfunction

constant function cs_I2D takes integer i returns destructable
return i
return null
endfunction

constant function cs_I2FM takes integer i returns fogmodifier
return i
return null
endfunction

//###########################################################################
function SetAggro takes handle mob, integer player, real aggro returns nothing
  call StoreReal(udg_cs_cache, I2S(cs_H2I(mob)), "aggro" + I2S(player), aggro)
endfunction

//===========================================================================
function InitTrig_CS_Main_Script takes nothing returns nothing
set udg_cs_cache = InitGameCache("WOWDATA.w3v")
endfunction

03-28-2006, 12:03 AM#2
Anitarf
player is not a valid variable name, since it's also a variable type. Use a different variable name, like p.
03-28-2006, 01:43 AM#3
Linera
It worked thanks.

So why can't I use player as a variable name?
03-28-2006, 02:23 AM#4
Vuen
Because it's also a variable type, as Anitarf said. Notice how it's highlighted light blue in the text you pasted above?
03-28-2006, 11:55 AM#5
Chuckle_Brother
Should give the error

"Handle Reserved for blah"

Use PID
03-28-2006, 05:58 PM#6
Linera
actually it didn't