Raised This Month: $ Target: $400
 0% 

[HELP] set_task[(id+TASK_NAME)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-20-2016 , 12:29   [HELP] set_task[(id+TASK_NAME)
Reply With Quote #1

Ahm, I've got some time playing with set_tasks, but I never been in this situation..
Can anyone explain to me please who index I use in check if is alive? the "idtask", or I have to do new id -= TASK_NAME and check id?

Code:
#define TASK_NAME 33333

public client_putinserver(id)
{
          set_task(1.0, "DisplayMessage", id+TASK_NAME)
}

public DisplayMessage(idtask)
{
         if(is_user_alive(?))
         {
                rabid rabbits
         }
}
__________________

Last edited by Depresie; 01-20-2016 at 12:30.
Depresie is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 01-20-2016 , 12:41   Re: [HELP] set_task[(id+TASK_NAME)
Reply With Quote #2

yes, you need id -= TASK_NAME to get the player's id
safetymoose is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-20-2016 , 12:57   Re: [HELP] set_task[(id+TASK_NAME)
Reply With Quote #3

https://forums.alliedmods.net/showpo...01&postcount=9
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-20-2016 , 14:15   Re: [HELP] set_task[(id+TASK_NAME)
Reply With Quote #4

You would not be using taskid. Think about it for a min. taskid = 33333+1. Do you think that's a valid client index?

is_user_alive(33334) don't seem right, now does it?
__________________
Spirit_12 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-20-2016 , 14:56   Re: [HELP] set_task[(id+TASK_NAME)
Reply With Quote #5

Thanks =P

One question tho, if I want to create two different hud messages, that sometimes may be displayed in the same time
Can I use just one of these?
PHP Code:
g_msgsync CreateHudSyncObj() 
__________________

Last edited by Depresie; 01-20-2016 at 14:58.
Depresie is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 01-20-2016 , 15:15   Re: [HELP] set_task[(id+TASK_NAME)
Reply With Quote #6

They would cancel eachother out, when 1st is shown, 2nd will be removed and vice-versa. The new message overwrites the old if they are on the same hud object.

You could create 2 separate hud objects and show both of them at the same time(assuming you're not using the same x,y coordinates). Just keep in mind that there's only 4 hud channels available, and there are other plugins that use those channels too and send hud messages...
safetymoose 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 09:22.


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