AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] set_task[(id+TASK_NAME) (https://forums.alliedmods.net/showthread.php?t=277923)

Depresie 01-20-2016 12:29

[HELP] set_task[(id+TASK_NAME)
 
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
        }
}


safetymoose 01-20-2016 12:41

Re: [HELP] set_task[(id+TASK_NAME)
 
yes, you need id -= TASK_NAME to get the player's id

abdobiskra 01-20-2016 12:57

Re: [HELP] set_task[(id+TASK_NAME)
 
https://forums.alliedmods.net/showpo...01&postcount=9

Spirit_12 01-20-2016 14:15

Re: [HELP] set_task[(id+TASK_NAME)
 
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?

Depresie 01-20-2016 14:56

Re: [HELP] set_task[(id+TASK_NAME)
 
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() 


safetymoose 01-20-2016 15:15

Re: [HELP] set_task[(id+TASK_NAME)
 
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...


All times are GMT -4. The time now is 09:22.

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