Part 1
Create a unit and save it into hashatble. ParentKey = 123456789 ; ChildKey = 0
Part 2
Print the name of the saved unit using the loaded value from hashtable. (you can do it in same function)
Create a unit and save it into hashatble. ParentKey = 123456789 ; ChildKey = 0
vJASS:
//! zinc
library Hashtable1 {
private {
hashtable hash = InitHashtable();
function onInit() {
SaveUnitHandle( hash, 123456789, 0,
CreateUnit( Player( PLAYER_NEUTRAL_PASSIVE ), 'hfoo', 0, 0, 0 )
);
}
}
}//! endzinc
Part 2
Print the name of the saved unit using the loaded value from hashtable. (you can do it in same function)
vJASS:
//! zinc
library Hashtable1 {
private {
hashtable hash = InitHashtable();
function onInit() {
SaveUnitHandle( hash, 123456789, 0,
CreateUnit( Player( PLAYER_NEUTRAL_PASSIVE ), 'hfoo', 0, 0, 0 )
);
DisplayTextToPlayer( GetLocalPlayer(), 0, 0,
GetUnitName( LoadUnitHandle( hash, 123456789, 0 ) )
);
}
}
}
//! endzinc