I cant figure it out. It seems that whenever I make callback of when state changes, then it will stay forever. But I want to cancel that callback after it is used (not making it stuck)! So after it has done whatever it does, if you release it, it will go back to its own spot and next time you use it, callback won't be used again and it is as... empty lever till i reassign this
!
help?
You can re-define the callback function without nothing in it.
I see
. TY! I also found method - maybe it helps someone:
void lever(string &in asTimer)
{
if(GetLeverState("levername") == -1/0/1) //whatever state u want
!
{
//DO ur stuff here
!
RemoveTimer("lever");
}
AddTimer("", 0, "lever");
}
(09-27-2011, 09:15 PM)Elven Wrote: [ -> ]I see . TY! I also found method - maybe it helps someone:
void lever(string &in asTimer)
{
if(GetLeverState("levername") == -1/0/1) //whatever state u want !
{
//DO ur stuff here !
RemoveTimer("lever");
}
AddTimer("", 0, "lever");
}
Well that does in fact work, I would prefer this type of thing. (although all cases vary naturally)
Code:
SetEntityConnectionStateChangeCallback("Ent", "StateChangeEnt");
void StateChangeEnt(string &in asEntity, int alState) { if(alState == 1) (stuff) else (stuff) }
-Edit- read it wrong... but information nontheless? : D