Raised This Month: $32 Target: $400
 8% 

Get task time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-04-2018 , 18:29   Get task time
Reply With Quote #1

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);
__________________









Last edited by CrazY.; 09-05-2018 at 09:56.
CrazY. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-05-2018 , 02:15   Re: Get task time
Reply With Quote #2

Do you have a usage example where it would be useful to have that native?
__________________
Arkshine is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-05-2018 , 09:52   Re: Get task time
Reply With Quote #3

Hmm, few examples not complex, but this really will depend about what each one need.

Spoiler


Spoiler


Spoiler
__________________








CrazY. is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-05-2018 , 12:04   Re: Get task time
Reply With Quote #4

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.
__________________
Black Rose is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-09-2018 , 10:01   Re: Get task time
Reply With Quote #5

All this is achievable by using variables.

And i dont think the flags should be called with bitsum.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 09-09-2018 at 10:01.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-09-2018 , 11:33   Re: Get task time
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
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
__________________
klippy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-09-2018 , 11:55   Re: Get task time
Reply With Quote #7

It should be moved into task_existed.
PHP Code:
native task_existed(taskidoutside=0flag=Task_TimeRemaining, &Float:return) 
Quote:
Originally Posted by KliPPy View Post
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 09-10-2018 at 14:11.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:42.


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