Raised This Month: $12 Target: $400
 3% 

set_task :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-29-2008 , 03:29   set_task :(
Reply With Quote #1

Ok, I'm confused again haha. Here's what I have:

Code:
new parameter[32]

for (new i = 3; i >= 0; i--)
{
	if (i == 3)
		parameter = "say /me gestures, 3..."

	if (i == 2)
		parameter = "say /me gestures, 2..."

	if (i == 1)
		parameter = "say /me gestures, 1..."

	set_task(1.0, "c2_countdown", id, parameter, 31)
}
Code:
public c2_countdown(id, parameter[])
{
	client_cmd(id, parameter)
}
I'm not sure if this will work correctly because nothing I've tried so far has. Set me straight?

Last edited by Ricky Leone; 10-29-2008 at 03:34.
Ricky Leone is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-29-2008 , 03:43   Re: set_task :(
Reply With Quote #2

Try this :

PHP Code:
#include <amxmodx>

#define TASKID1    134567849

new g_iMaxPlayer

public plugin_init()
{
    
register_clcmd("test""cmdTest")

    
g_iMaxPlayer get_maxplayers()
}

public 
cmdTest(id)
{
    new 
params[32]
    for (new 
03i++)
    {
        
formatex(paramscharsmax(params), "say /me gestures, %d..."3-i)

                                
// don't set the same taskid
        
set_task(1.0+i"c2_countdown"id+(TASKID1*i), paramscharsmax(params))
    }
}

// params come in 1st
public c2_countdown(parameter[], id)
{
    while( 
id g_iMaxPlayer )
    {
        
id -= TASKID1
    
}
    
client_cmd(idparameter)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-29-2008 , 03:49   Re: set_task :(
Reply With Quote #3

Could you explain why you add i to 1.0 in set_task, and why you fetch maxplayers? That's just confusing me more. :/

Also, it's a countdown, not a countup. But that's fine, I can just reverse what you've done there.
Ricky Leone is offline
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 10-29-2008 , 04:06   Re: set_task :(
Reply With Quote #4

wait im confused what are u trying to do?
whosyourdaddy is offline
Ricky Leone
Junior Member
Join Date: Dec 2005
Old 10-29-2008 , 04:17   Re: set_task :(
Reply With Quote #5

Trying to make the client execute parameter.
Ricky Leone 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 14:19.


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