AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=7)
-   -   Get task time (https://forums.alliedmods.net/showthread.php?t=310467)

CrazY. 09-04-2018 18:29

Get task time
 
Hello, my suggestion is to add a native to get task time with flags:

Code:
enum GetTaskTimeFlags (<<= 1) {     GetTaskTime_None = 0,     GetTaskTime_Remaining = 1,     GetTaskTime_RepeatTimes,     GetTaskTime_RepeatTime, }; /**  * Returns the time of a task.  *  * @param iTaskId     Task id to search for  * @param iOutside    Will also search tasks from other plugins if nonzero  * @param bitsFlags   Optional flags (enum GetTaskTimeFlags); valid flags are:  *                        GetTaskTime_None - Returns how long time the task has gone (default)  *                        GetTaskTime_Remaining - Returns remaining time to the callback be called  *                        GetTaskTime_RepeatTimes - Returns total repeat times  *                        GetTaskTime_RepeatTime - Returns current repeat time  */ native get_task_time_ex(iTaskId = 0, iOutside = 0, GetTaskTimeFlags:bitsFlags = GetTaskTime_None);

Arkshine 09-05-2018 02:15

Re: Get task time
 
Do you have a usage example where it would be useful to have that native?

CrazY. 09-05-2018 09:52

Re: Get task time
 
Hmm, few examples not complex, but this really will depend about what each one need.

Spoiler


Spoiler


Spoiler

Black Rose 09-05-2018 12:04

Re: Get task time
 
Your examples doesn't represent real obstacles you face when programming. All you've done is built examples around your suggested function. "It might be good" is really not a reason to do unnecessary work.

Natsheh 09-09-2018 10:01

Re: Get task time
 
All this is achievable by using variables.

And i dont think the flags should be called with bitsum.

klippy 09-09-2018 11:33

Re: Get task time
 
Quote:

Originally Posted by Natsheh (Post 2614395)
All this is achievable by using variables.

And i dont think the flags should be called with bitsum.

https://github.com/alliedmodders/amxmodx/pull/389

Natsheh 09-09-2018 11:55

Re: Get task time
 
It should be moved into task_existed.
PHP Code:

native task_existed(taskidoutside=0flag=Task_TimeRemaining, &Float:return) 

Quote:

Originally Posted by KliPPy (Post 2614404)



All times are GMT -4. The time now is 01:51.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.