AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_task question (https://forums.alliedmods.net/showthread.php?t=172317)

Diegorkable 11-18-2011 20:57

set_task question
 
Hey guys I have problems with getting parameters to a set_task, and I was thinking Im using it right but now I see I dont get the correct values:

I have a function

PHP Code:

strike_game(iParams[], id

And if I want to set a task to it with my params I do(for example):

PHP Code:

public client_connect(id)
{
        new 
Params[4]
        
Params[0] = 0
        Params
[1] = 1
        Params
[2] = 5
        Params
[3] = 10

        set_task
(10.0"strike_game"idParams)


Now, how do I know that the values are incorrect?

Cuz in strike_game function I have an 'if' that checks is_user_connected || !is_user_alive of that id sent, and it always gets blocked there, and I dont understand why (I realized it with placing client_print's).

Why do I use it wrongly?

padilha007 11-18-2011 21:05

Re: set_task question
 
This may help you:

PHP Code:

http://forums.alliedmods.net/showpost.php?p=1463372&postcount=2 

For more information:

PHP Code:

http://forums.alliedmods.net/search.php?searchid=8225322 


Diegorkable 11-18-2011 21:08

Re: set_task question
 
nvm lol oh me so stupid, sorry for the useless thread.
Forgot to state the amount of params in the function "set_task"

Emp` 11-18-2011 23:16

Re: set_task question
 
Just a helpful hint to make sure you send the entire array:

Code:

set_task( fTime, szFunc, iTaskID, iParams, sizeof iParams );


All times are GMT -4. The time now is 08:23.

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