Raised This Month: $ Target: $400
 0% 

set_task & sequence question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 07-06-2006 , 12:30   set_task & sequence question
Reply With Quote #1

Hello,

I made a function that requires 2 inputes, the players id and a variable

Code:
public playsound(id, number){
     switch(number){
           case 1:{ emit_sound(id, CHAN_BODY, "sounds/ss/1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) }
           case 2:{ emit_sound(id, CHAN_BODY, "sounds/ss/2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) }
     }
}
now i want to call the function up in set_task
is this the right way to call it up?

Code:
public sound_system(id){
     set_task(1.0, "playsound", id, "1")
     set_task(2.0, "playsound", id, "2")
}

Last edited by SSJ2GOKU; 07-07-2006 at 17:41. Reason: changed title
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-06-2006 , 14:35   Re: set_task question
Reply With Quote #2

Code:
new param[2]; param[0] = id; param[1] = num; set_task(1.0, "playsound", (id + 12345), param, 2);

Then in your playsound function:
Code:
public playsound(param[2]) {   new id = param[0];   new num = param[1];   // ... }
or something.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 07-07-2006 , 11:50   Re: set_task question
Reply With Quote #3

Quote:
Originally Posted by v3x
Code:
new param[2]; param[0] = id; param[1] = num; set_task(1.0, "playsound", (id + 12345), param, 2);
what means the 12345 ?
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
Zenith77
Veteran Member
Join Date: Aug 2005
Old 07-07-2006 , 15:21   Re: set_task question
Reply With Quote #4

You need a unique taskid, or else the core will over write your task's data, due to another plugin. So basically its just some random number.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 07-07-2006 , 15:55   Re: set_task question
Reply With Quote #5

Not true, it's possible to create numerous tasks with the same ID.
Task ID prefixes is useful for example to operate with the different task groups.
VEN is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 07-07-2006 , 17:09   Re: set_task question
Reply With Quote #6

Quote:
Originally Posted by Zenith77
You need a unique taskid, or else the core will over write your task's data, due to another plugin. So basically its just some random number.
Lies!

Quote:
Originally Posted by VEN
Not true, it's possible to create numerous tasks with the same ID.
Task ID prefixes is useful for example to operate with the different task groups.
Truths!
__________________
Brad is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 07-07-2006 , 17:38   Re: set_task question
Reply With Quote #7

erm im getting confused

btw does anyone know this:
how to make a model's sequence fully run and then reset it back to beginning so it runs again?
like a sequence loop

PLS DO NOT SAY SERVER_FRAME, because that fucks up the sequence

i know these are needed
Code:
entity_set_int(entid[id], EV_INT_sequence, #seqnr)
entity_set_int(entid[id], EV_INT_gaitsequence, 0)

Last edited by SSJ2GOKU; 07-07-2006 at 17:52.
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-08-2006 , 04:09   Re: set_task & sequence question
Reply With Quote #8

client_PreThink
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
3xr
Junior Member
Join Date: Mar 2005
Old 07-08-2006 , 04:43   Re: set_task & sequence question
Reply With Quote #9

Hey, IM me, I think we are on the same path of something similar to ESF.

Aim: x3xRx
3xr is offline
SSJ2GOKU
Senior Member
Join Date: Oct 2005
Location: Belgium
Old 07-08-2006 , 13:16   Re: set_task & sequence question
Reply With Quote #10

i'm gonna test it out if it works

btw ty for the help
SSJ2GOKU is offline
Send a message via MSN to SSJ2GOKU
Reply


Thread Tools
Display Modes

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 08:02.


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