home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


help w/ sound code.

by scared STUpid on 10/18/2006 01:14, 4 messages, last message: 10/19/2006 19:34, 1046 views, last view: 05/04/2024 05:40

hi. could one of you guys help me? i\'m giving the menu a sound when you open it. but i\'m getting a compiling error.

I added this is menus.cpp...

void menuset(int menu)
{

if((vmenu = menu)>=1) player->stopmoving();
if(vmenu==1) menus[1].menusel = 0;
{
//new below
#include \"game.h\"
if(vmenu==1) playsound(S_RLFIRE);
};
//new end
};


and I get this error while compiling..

------ Build started: Project: sauerbraten, Configuration: Release Win32 ------
Compiling...
menus.cpp
..\\fpsgame\\game.h(73) : error C2624: \'menuset::fpsent\' : local classes cannot be used to declare \'extern\' variables
Build log was saved at \"***\"
sauerbraten - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

i\'m kinda a n00b but learned alot more. someone help me fix it? i\'ll keep trying anyways... giving the menu a opening sound would be sweet, dontcha think ;)

   Board Index   

#1: dont

by conorkirk-where-is-my-cookie? on 10/18/2006 06:34

Don't do it, these people will think you are getting an unfair advantage...

reply to this message

#2: ..

by rancor on 10/18/2006 11:07

Just a guess, but I'd say that including game.h there is a bad idea. Do it at the top of the file.

reply to this message

#3: ..

by scared STUpied on 10/19/2006 02:19

yeah i found that out myself yesterday. simple mistake. But would someone know a code to stop a sound from playing if it already is playing? tanks.

reply to this message

#4: Re: ..

by scared STUpied on 10/19/2006 19:34, refers to #3

please help someone, i need a code that will stop a sound if it already playing

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53867585 visitors requested 71642744 pages
page created in 0.018 seconds using 10 queries
hosted by Boost Digital