se7enet purgatorio

Page 1 of 1 1
Topic Options
Rate This Topic
#18716 - 11/18/08 08:51 PM Sound or No Sound
worshiploud
Grape Nuts


Registered: 10/25/08
Posts: 48
Loc: MO

Offline
I have sound in my game.
When a player is fighting there is a red alert sound.
Sound Good
or
Sound Bad

Not that I expect to get help but here it goes anyway.

I have this sound and I would like to make a toggle button that will turn sound on or off in the game.

In the database I have made a field in the user table called sound.

It is default to 1.

I don't know how to
A:
make a button that passes 1 or 0 to the sound field.
B:
make the sound play if saund=1 and not play of sound=0

I have the sound embeded next to the fighting image on templates/fight.php

I can only guess at how to do this.
_________________________
SCUD248

Top
#18720 - 11/19/08 05:12 AM Re: Sound or No Sound [Re: worshiploud]
AnmanIndustries
Cookie Crisp
*****

Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth

Offline
Sound will slow down page loads and drain a lot of bandwidth very quickly.

Just do a link. Dont worry about buttons if youre not sure. First, make a function. In that function, set the database for that user to 0. Sound is off. Then have another function, same thing, but it sets the database to 1. Sound is on. When you have the code that makes the sound play, check userrow to see if that field is 1 or 0. If its 1, play, else nothing.

Of course, that is the EASIEST way of doing it. its not very efficient and there are better ways of going about it.
_________________________
If you want me to punch you in the nuts go to:
http://www.AnmanIndustries.com

I'll do it for free too. Enjoy.

Top
#18721 - 11/19/08 07:04 AM Re: Sound or No Sound [Re: AnmanIndustries]
worshiploud
Grape Nuts


Registered: 10/25/08
Posts: 48
Loc: MO

Offline
Thanks for the reply.
I decided to put a poll up for the players to vote on it too.
Since it seems like it loads pretty quick and I have like 8 TB of bandwidth per month the sound thing seems to be fine for now.

I appreciate the input on this because you have been working with this for a long time and you know it better than me by far.
_________________________
SCUD248

Top
#18725 - 11/19/08 08:42 AM Re: Sound or No Sound [Re: worshiploud]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
I don't recommend sound.
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
#18729 - 11/19/08 01:24 PM Re: Sound or No Sound [Re: Fayt]
worshiploud
Grape Nuts


Registered: 10/25/08
Posts: 48
Loc: MO

Offline
 Originally Posted By: Fayt
I don't recommend sound.


Thank you for the input, I value your opinion as a veteran of this script.

My player poll is tight. It's almost a 50/50 split. Since we are in the "highspeed" age, people aren't complaining about speed.
The one who don't like the sound say it makes them have to turn off sound at work.

I am leaning toward removing the sound.
_________________________
SCUD248

Top
#18735 - 11/19/08 03:19 PM Re: Sound or No Sound [Re: worshiploud]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
Those people with dial up are screaming their heads off.
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
#18745 - 11/20/08 04:52 PM Re: Sound or No Sound [Re: Fayt]
AnmanIndustries
Cookie Crisp
*****

Registered: 03/21/05
Posts: 2876
Loc: Planet Stupid, AKA Earth

Offline
Yeah. Bandwidth not just for your site, but for other people too. In todays age of HIGHSPEED INTERWEBS? Yeah right. People are using wireless and mobile internet a lot more these days and its a LOT slower. Also, it seems only america, the UK and some asian countries have HIGH SPEED INTERNET as a standard. In Australia you can get high speed easily, but its price is insane so most people opt for a low limited bandwidth of 200-1000mb a month. Not to mention, examples like me, where Im putting wireless internet into my car. It wont be as fast and I will have limited bandwidth.
_________________________
If you want me to punch you in the nuts go to:
http://www.AnmanIndustries.com

I'll do it for free too. Enjoy.

Top
#18747 - 11/20/08 07:50 PM Re: Sound or No Sound [Re: AnmanIndustries]
Fayt
Crunchberries
***

Registered: 11/08/05
Posts: 1131
Loc: My Computer, USA

Offline
Yeah and on shared hosting, you share a server with like 100 other people. So if you use tons of bandwidth you slow them down. What happens when they do it to you? BOOM Server Load: 80.00
_________________________
MasterFayt - Amara 5 - Manas - Banar

Top
#18748 - 11/20/08 10:40 PM Re: Sound or No Sound [Re: Fayt]
worshiploud
Grape Nuts


Registered: 10/25/08
Posts: 48
Loc: MO

Offline
 Originally Posted By: Fayt
Yeah and on shared hosting, you share a server with like 100 other people. So if you use tons of bandwidth you slow them down. What happens when they do it to you? BOOM Server Load: 80.00



The fact is that all of the other 100 sites hosted on the server, are mine. I can slow them all down as much as I want, If I want to.

But I took the sound off just because I didn't like it anymore.

USA USA USA USA USA Palin McCain USA "Drill Baby Drill" \:\)
_________________________
SCUD248

Top
Page 1 of 1 1


Hop to:

se7enet

Barack Obama Logo