voila mon script :
il est pas tro compliquer mais il ne fonctionne pas
ce que je veux c´est qu´on entandre le son émis de chaque client
sur tout les autres clients
//////////////////////////////////////////////////
///////
//drum sound
var sonsjouer = 0;
var sonsserveur = 0;
sound hihat_sound,<hihat.wav>;
sound bassdrum_sound,<bassdrum.wav>;
sound snare_sound,<snare.wav>;
sound symbal1_sound,<symbal1.wav>;
sound symbal2_sound,<symbal2.wav>;
sound tom1_sound,<tom1.wav>;
sound tom2_sound,<tom2.wav>;
sound guit1_sound,<guit1.wav>;
sound guit2_sound,<guit2.wav>;
sound guit3_sound,<guit3.wav>;
function avoirleson()
{
if(sonsjouer == 1) { play_sound(hihat_sound,78); }
if(sonsjouer == 2) { play_sound(bassdrum_sound,78); }
if(sonsjouer == 3) { play_sound(snare_sound,78); }
if(sonsjouer == 4) { play_sound(symbal1_sound,78); }
if(sonsjouer == 5) { play_sound(symbal2_sound,78); }
if(sonsjouer == 6) { play_sound(tom1_sound,78); }
if(sonsjouer == 7) { play_sound(tom2_sound,78); }
if(sonsjouer == 8) { play_sound(guit1_sound,78); }
if(sonsjouer == 9) { play_sound(guit2_sound,78); }
if(sonsjouer == 10) { play_sound(guit3_sound,78); }
wait(3);
}
function hihat_SND
{
sonsjouer = 1;
sonsserveur = 1;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function bassdrum_SND
{
sonsjouer = 2;
sonsserveur = 2;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function snare_SND
{
sonsjouer = 3;
sonsserveur = 3;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function symbal1_SND
{
sonsjouer = 4;
sonsserveur = 4;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function symbal2_SND
{
sonsjouer = 5;
sonsserveur = 5;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function tom1_SND
{
sonsjouer = 6;
sonsserveur = 6;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function tom2_SND
{
sonsjouer = 7;
sonsserveur = 7;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
//////////////////////////////////////////////////
///////
//guitar sound
function guit1_SND
{
sonsjouer = 8;
sonsserveur = 8;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function guit2_SND
{
sonsjouer = 9;
sonsserveur = 9;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
function guit3_SND
{
sonsjouer = 10;
sonsserveur = 10;
dplay_sync = 1; send_var (sonsserveur);
avoirleson();
wait(3);
}
//////////////////////////////////////////////////
///////////////////////
//////////////////////////////////////////////////
////
on_1 hihat_SND;
on_2 bassdrum_SND;
on_3 snare_SND;
on_4 symbal1_SND;
on_5 symbal2_SND;
on_6 tom1_SND;
on_7 tom2_SND;
on_z guit1_SND;
on_x guit2_SND;
on_c guit3_SND;
//////////////////////////////////
voila évidament j´ai insérer le code :
dans la function main
//////////////////////////////////////////////////
////////////////
if (connection & CONNECT_CLIENT)
{
// wait until the level is loaded, and the connection is established
while (connection == 0) { wait(1); }
if(sonsserveur == 1) { play_sound(hihat_sound,78); }
if(sonsserveur == 2) { play_sound(bassdrum_sound,78); }
if(sonsserveur == 3) { play_sound(snare_sound,78); }
if(sonsserveur == 4) { play_sound(symbal1_sound,78); }
if(sonsserveur == 5) { play_sound(symbal2_sound,78); }
if(sonsserveur == 6) { play_sound(tom1_sound,78); }
if(sonsserveur == 7) { play_sound(tom2_sound,78); }
if(sonsserveur == 8) { play_sound(guit1_sound,78); }
if(sonsserveur == 9) { play_sound(guit2_sound,78); }
if(sonsserveur == 10) { play_sound(guit3_sound,78); }
wait(3);
}
//////////////////////////////////////////////////
///////////
fin