- Joined
- Dec 14, 2005
- Messages
- 10,532
To keep out a potential deluge of threads with very small functions, this thread is for you to post short functions you wish to share.
Normal or long-length snippets still go the same place as always.
So, if you have something worth sharing, post it here!
Functions
Normal or long-length snippets still go the same place as always.
So, if you have something worth sharing, post it here!
Functions
- Line/Triangle Snippets
- Cinematic Utilities
- CreateUnitWithDifferentModel
- Projection Snippets
- Is Unit-Type Id
- Rect Data
- Add Commas
JASS:
//By Silvenon
function PreloadSoundPath takes string path returns nothing
local sound snd = CreateSound(path, false, false, false, 10, 10, "")
call SetSoundVolume(snd, 0)
call StartSound(snd)
call KillSoundWhenDone(snd)
set snd = null
endfunction
JASS:
//By DiscipleOfLife and Troll-Brain
library QuickTimer
//=======================================================================
// Attaches an integer to a timer and makes it expire after 0 seconds.
// The integer passed must be a positive value.
//
function TimerExpireQuick takes timer t, integer data, code func returns nothing
call TimerStart(t, -data, false, func)
endfunction
//=======================================================================
// Returns the integer attached to a quick timer.
//
function QuickTimerGetData takes timer t returns integer
return -R2I(TimerGetTimeout(t))
endfunction
endlibrary
Last edited by a moderator: