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

this is simple but i just cant figure it out


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 02-20-2007 , 12:53   this is simple but i just cant figure it out
Reply With Quote #1

Code:
public client_putinserver(id)
{

  if(g_crowd[id] == 0)
    {
    g_crowd[id] = 1
    set_task(1.0, "crowd_sound")
    }
    else
    {
    return PLUGIN_HANDLED
    }
}
public crowd_sound(id)
{

        client_cmd(id, "spk voi/sj/crowd_b1")

}
i want to play sound of crowd in map soccerjam to each player on connect(and this has to be only once since the sound is looped), but this is actually called everytime player is connected(so the client_cmd is called to player when each player gets connected and sound is played multiple times), how do i fix this ?
__________________

Last edited by Voi; 02-20-2007 at 13:15.
Voi is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 02-20-2007 , 15:03   Re: this is simple but i just cant figure it out
Reply With Quote #2

Your not declaring id in the set task parameters.

So set task is executing on all clients, not just the one client you want.

Also, if(g_crowd[id] == 0) is the same as if(!g_crowd[id]).
organizedKaoS is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 02-20-2007 , 16:05   Re: this is simple but i just cant figure it out
Reply With Quote #3

Quote:
Originally Posted by organizedKaoS View Post

So set task is executing on all clients, not just the one client you want.
uh, so how to do this ?
btw thx for reply
__________________
Voi is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 02-20-2007 , 19:28   Re: this is simple but i just cant figure it out
Reply With Quote #4

set_task(1.0, "task", id)
organizedKaoS is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 02-20-2007 , 19:39   Re: this is simple but i just cant figure it out
Reply With Quote #5

aahhh, i didnt saw this was missing thx
__________________
Voi 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 09:19.


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