SA-MP Forums Archive
Function question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Function question (/showthread.php?tid=106819)



Function question - (.Aztec); - 05.11.2009

Does there happen to be a function named "DoesPlayerHaveATimerRunning" or something like that? I need it for a server i'm making, I know there's a way of assigning a variable through every single timer, but i'd rather not do so.

Thanks,

sizeof.

EDIT: Bleh, wrong section, meant to be Scripting Discussion.


Re: Function question - Redgie - 05.11.2009

The variable technique is really the only way of doing it unfortunately. But you could create a function called CreatePlayerTimer, which assigns an ID to the player in question using the ID of the timer, then when the timer expires, it carries out the desired affect on the player in the server with timer[playerid] set as the timer ID


Re: Function question - (.Aztec); - 05.11.2009

Quote:
Originally Posted by Y_Leѕѕ
There's no such thing as a player timer, so no. You need to get your concepts straight before asking for functions like that.
...I didn't mean it literally, say I set their timer, I want to check if the timer is ACTUALLY running.

EDIT: Read redgies post.. Thanks, i'll do that, then.


Re: Function question - madman227 - 06.11.2009

In the code the timer is checking you can put print("timer is running"); and it will show in the server window timer is running..Hope this helps you out!
Quote:
Originally Posted by sizeof(Sky));
Quote:
Originally Posted by Y_Leѕѕ
There's no such thing as a player timer, so no. You need to get your concepts straight before asking for functions like that.
...I didn't mean it literally, say I set their timer, I want to check if the timer is ACTUALLY running.

EDIT: Read redgies post.. Thanks, i'll do that, then.



Re: Function question - troy52192 - 06.11.2009

the only way to make ur own callbacks is to make an inc file and make natives of what that callback is gonna do


Re: Function question - Daren_Jacobson - 06.11.2009

1. it doesn't have to be in an include file
2. if you are making your custom functions native i might shoot you.