07.06.2012, 13:16
That's not possible, the callback is supposed to be called every time a new piece of information is synced by the user, which means it will get called a lot.
You should consider using a timer instead, using SetTimer or SetTimerEx depending on which one is most appropriate for your situation.
https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx
With that said, if you literally meant you only want it to do something once then why are you using it at all? Simply use another callback such as OnPlayerConnect which is only called once when the player connects, but I don't really know which one is most appropriate for you with so little information.
You should consider using a timer instead, using SetTimer or SetTimerEx depending on which one is most appropriate for your situation.
https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/SetTimerEx
With that said, if you literally meant you only want it to do something once then why are you using it at all? Simply use another callback such as OnPlayerConnect which is only called once when the player connects, but I don't really know which one is most appropriate for you with so little information.