AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [TFC] Set_Task doesn't start (https://forums.alliedmods.net/showthread.php?t=270903)

Vancold 09-01-2015 04:53

[TFC] Set_Task doesn't start
 
Hey

Code:

new color[3]
 
    for(new i = 0; i < g_SimonIndex[id ]; i++) {
 
        client_print(id,print_chat,"%d",g_ColorArray[id][i])
 
        switch(g_ColorArray[id][i]) {
       
       
       
            case RED: {
       
                color[0] = 255
                color[1] = 0
                color[2] = 0
       
            }
       
       
            case GREEN: {
           
                color[0] = 0
                color[1] = 255
                color[2] = 0
       
            }
       
       
            case BLUE:{
           
                color[0] = 0
                color[1] = 0
                color[2] = 255
       
            }
       
       
            case YELLOW:{
           
                color[0] = 255
                color[1] = 255
                color[2] = 0
       
            }
        }
       
        client_print(id,print_chat,"Red: %d ; Green: %d ; Blue: %d",color[0],color[1],color[2])
        set_user_rendering(id,kRenderFxGlowShell,color[0],color[1],color[2],kRenderNormal,16)
        set_task(0.75,"wait",1)
       
    }

   
    set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderNormal,25)

This code should get a color display it, wait for 0.75 seconds and then switch ect, (SimonIndex is a int value ranging from 4 to 10.

The problem is that the code gets rushed through in 0.01 secs or something like that. I don't know why.

Why?
This function gets called by a menu

The function name is wait. no typos. Wait only contains return PLUGIN_CONTINUE.
IDK what to do. Tried everything but it rushes the set_Task.
BTW: I am using 3rd person to watch it, so i am pretty sure that it doesnt work

Vancold 09-01-2015 11:06

Re: [TFC] Set_Task doesn't start
 
i wasn't bumping, i am just confused as to why it doesn't work.
Why should i bump a topic that is almost in top spot anyways? lol
a bump post would be

bump

or up

...

Vancold 09-02-2015 06:28

Re: [TFC] Set_Task doesn't start
 
Topic can be deleted / closed. Found the reason why.
Thought the ID i call in the task is the user id. It is the task id.
Set up the task ID accordingly to the user.

Now it does work


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

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