Raised This Month: $ Target: $400
 0% 

tasks


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-19-2010 , 18:24   Re: tasks
Reply With Quote #3

Quote:
Originally Posted by liryck View Post
um well srry by the threat but i have another question and well the other is tutorials forums.

so lets see i have a task in the function AwesomeMenu right so when i call AwesomeMenu the task start too right?

the task is like seta told me set_task(10.0,"random_choose",menu_id)

so i want to remove that task if the player who got the menu choose an option, the right way should be remove_task(menu_id). if im right at this moment all good.

now my question is when i call again AwesomeMenu the task start again? if not how i make to started again
menu_id would be the task-id. Think of it as an identification number for that particular task. If this is the only usage for tasks in your plugin then you can always use the player-id as the task-id. Otherwise you will need a little extra, let me know if this is the case.

This might help:
PHP Code:
AwesomeMenuid )
{
     
showmenuid );
     
set_task10.0 "random" id );
}

MenuChooserid )
{
      
//player (id) chose something on menu
      
remove_taskid );
}

public 
randomid )
{
     
//callfunc( id );
     //get_user_health( id );
     //or w\e

__________________
Bugsy is offline
 



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:36.


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