Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Scripting problem! Help needed! (https://forums.graalonline.com/forums/showthread.php?t=83705)

[email protected] 01-15-2009 10:18 PM

Scripting problem! Help needed!
 
Ok, So I scripted a car on my server and it works fine. I have a script to where if you press "f", it will play the horn noise I made. here is the script.

function onKeyPressed() {
if (keydown2(getkeycode("f"), true)) {
playlooped carhorn-1.wav;
}
}


I hear it fine, But I ask other people if they hear it, and they dont. How can I make this to where others can hear my horn noise to?

Please help.

thanks

-jamerson

Soala 01-15-2009 10:19 PM

Just make sure the sound is in the file browser of your server (Remote Control) so others can load it, else it would just play from your own folder.

Oh and please, stop making threads about songs only x_x

[email protected] 01-15-2009 10:22 PM

So I upload the .wav file into the sounds folder and it should work?

Chompy 01-15-2009 10:24 PM

Well, the sound is played on the clientside, thus making it only hearable for the current player. You can mess around with play2(file, x, y, volume) or something like that, or look into using a gani

Soala 01-15-2009 10:24 PM

Of course, that's what the file browser from your remote control is for, you upload the file you want to use so others get it and can perfectly see/hear it

Matt 01-15-2009 10:28 PM

Check out the GraalBible (Or http://wiki.graal.us/Index), there's alot of useful information in there you'll need. The link is in my signature. :)

[email protected] 01-16-2009 12:28 AM

Quote:

Originally Posted by [email protected] (Post 1457326)
Ok, So I scripted a car on my server and it works fine. I have a script to where if you press "f", it will play the horn noise I made. here is the script.

function onKeyPressed() {
if (keydown2(getkeycode("f"), true)) {
playlooped carhorn-1.wav;
}
}


I hear it fine, But I ask other people if they hear it, and they dont. How can I make this to where others can hear my horn noise to?

Please help.

thanks

-jamerson

PHP Code:

function onTimeOut()
{
 if (
keydown2(getkeycode("f"), true))
 {
  
playlooped("carhorn-1.wav");
 }
 
setTimer(0.05);


Try this it should work

Deas_Voice 01-16-2009 01:17 PM

Quote:

Originally Posted by Matt (Post 1457336)
The link is in my signature. :)

no it's not, its the wiki.graal.net ( aka graal bible, graal wiki ) in your signature.

[email protected] 01-16-2009 06:28 PM

no @ zeek- still that's clientside.

as Chompy said, use a gani attr. :)

Soala 01-16-2009 06:38 PM

Quote:

Originally Posted by [email protected] (Post 1457331)
So I upload the .wav file into the sounds folder and it should work?

Guys it's just a sound problem, only him can hear it which means only him has the sound file in his folders. He just has to upload it in the file browser (on RC) to share it with others !

[email protected] 01-16-2009 06:41 PM

nope @ alexandralove
it's the script he's using, if it were in a gani then everyone can hear it [as a gani is on everyones computer] but as he's using that script in a weapon he can only hear what he triggers

xXziroXx 01-16-2009 07:21 PM

Quote:

Originally Posted by alexandralove (Post 1457474)
Guys it's just a sound problem, only him can hear it which means only him has the sound file in his folders. He just has to upload it in the file browser (on RC) to share it with others !

Wrong.

Quote:

Originally Posted by [email protected] (Post 1457475)
nope @ alexandralove
it's the script he's using, if it were in a gani then everyone can hear it [as a gani is on everyones computer] but as he's using that script in a weapon he can only hear what he triggers

Correct.


All times are GMT +2. The time now is 11:33 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.