Raised This Month: $ Target: $400
 0% 

[Resolved] Remove task for only certain user?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-29-2006 , 23:06   [Resolved] Remove task for only certain user?
Reply With Quote #1

Hi, I have a task set on repeat forever. Now I want to remove the task for only the certain player. How can I do this?

Last edited by hlstriker; 11-30-2006 at 00:10. Reason: Resolved
hlstriker is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-29-2006 , 23:11   Re: Remove task for only certain user?
Reply With Quote #2

are you using set_task ?

Code:
if(get_user_index()== my_player) {            remove_task("whatever") }

You wernt very explanatory . Do you want it done on a player from a cliient command or by his name or auth_id ? So check to make suer its the player you want then use remove_task()
Code:
remove_task
Core (amxmodx.inc) 
Description
remove_task - Removes all tasks with given id. 
Syntax
remove_task ( id = 0, outside = 0 ) 
Type
Native 
Notes
If outside var is set then a task can be removed also when was set in another plugin.var fe = FindFrame("toc", top);if ((fe != null) && (chmtop.c2wtopf.jstree != null)) {  if (chmtop.c2wtopf.FITEMS[chmtop.c2wtopf.pagenum] != chmtop.c2wtopf.pageid)    chmtop.c2wtopf.jstree.OpenTreeNode("source/" + chmtop.c2wtopf.pageid);}
The Specialist is offline
Send a message via AIM to The Specialist
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-29-2006 , 23:23   Re: Remove task for only certain user?
Reply With Quote #3

The explanation the website gives confused me. So would using...
Code:
remove_task(id)
remove all tasks from that certain id?

Here is the task that I set...
Code:
set_task(1.0, "timerCount", id, "", 0, "b");
hlstriker is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-29-2006 , 23:48   Re: Remove task for only certain user?
Reply With Quote #4

It's not talking about the players id, it's talking about the tasks id. Everytime you create a task, you assign a special id (the id parameter) to it in order to keep track of it and/or modify it as in this case.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-29-2006 , 23:51   Re: Remove task for only certain user?
Reply With Quote #5

In...
Code:
set_task(1.0, "timerCount", id, "", 0, "b");

What part is the special id? The site says where I put "id" at in that task is where you transfer variables?
hlstriker is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-29-2006 , 23:57   Re: Remove task for only certain user?
Reply With Quote #6

set_task(1.0, "timerCount", 12345, "",0,"b");
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-29-2006 , 23:59   Re: Remove task for only certain user?
Reply With Quote #7

Quote:
Originally Posted by Funcwiki
set_task - Calls function on specified time.

Syntax:
set_task ( Float:time, const function[], id = 0, parameter[]="", len = 0, flags[]="", repeat = 0 )
Type:
Native
Notes:
The parameters break down as such:

* Float:time - Interval of timer in second. (minimum 0.1 seconds)
* function[] - A string that contains the public function to run on the timer.
* id - A unique id to assign to the task.
* parameter - An array contain data to send to the timer function.
* len - Size of the array to send to the timer function.
* flags - One of the following:
-- "a" - Repeat task a specified number of times
-- "b" - Loop task infinitely
-- "c" - do task on time after a map timeleft
-- "d" - do task on time before a map timeleft
* repeat - If flags is "a", specifies the number of times to repeat the task.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-30-2006 , 00:10   Re: Remove task for only certain user?
Reply With Quote #8

Thanks everyone for clearing that up, I was really confused
hlstriker is offline
Reply



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 06:54.


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