Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Radio/Music Script Help (https://forums.graalonline.com/forums/showthread.php?t=134260570)

brasilboy109 09-19-2010 03:40 AM

Radio/Music Script Help
 
Ok this time im working on a radio script but idk how to play the song serverside/ to everyone

When i type
Quote:

:start musicurl
it only plays the song file to myself
how would i go about making it serverside??

PHP Code:

 function onPlayerChats(){
 if (
player.chat.starts(":start")){
 
this.song player.chat.substring(7);
 
play(this.song);
 
player.chat "";
 }



MattKan 09-19-2010 04:10 AM

Don't put it as Clientside?

Demisis_P2P 09-19-2010 04:20 AM

you can't really.
graal sucks at almost everything audio related.

Mark Sir Link 09-19-2010 05:27 AM

you need to trigger clients to make the song play for them also.

in a weapon everyone has like -MusicSystem try something like

PHP Code:

function onActionServerside(cmdp1){
  if(
cmd == "playall"){
    for(
temp.pallplayers){
      
p.triggerclient(this.name"play"p1);
    }
  }
}

//#CLIENTSIDE
function onPlayerChats(){
  if(
player.chat.starts(":start")){
    
triggerserver("gui"this.name"playall"player.chat.substring(7));
  }
}

function 
onActionClientside(cmdp1){
  if(
cmd == "play"){
    
play(p1);
  }


Not tested

xAndrewx 09-19-2010 11:23 AM

Your triggerclient is wrong?
triggerclient("weapon", this.name... etc)

Skyld 09-19-2010 03:10 PM

Quote:

Originally Posted by xAndrewx (Post 1601453)
Your triggerclient is wrong?
triggerclient("weapon", this.name... etc)

"weapon" and "gui" are the same.

cbk1994 09-19-2010 05:55 PM

Quote:

Originally Posted by Skyld (Post 1601459)
"weapon" and "gui" are the same.

Which is why he pointed out the triggerclient, not the triggerserver ^^

PHP Code:

p.triggerclient(this.name"play"p1); 

was the part he was referring to

Skyld 09-19-2010 06:08 PM

Quote:

Originally Posted by cbk1994 (Post 1601481)
Which is why he pointed out the triggerclient, not the triggerserver ^^

PHP Code:

p.triggerclient(this.name"play"p1); 

was the part he was referring to

I guess that's what I get for not reading the thread properly >_<

xAndrewx 09-19-2010 08:11 PM

yeah in your face!!! right there in ya face!!!

Chompy 09-19-2010 08:34 PM

Use a ganiscript :) No need to trigger then

Mark Sir Link 09-19-2010 09:04 PM

Script help for 'triggerclient':
triggerclient(str)
TServerPlayer.triggerclient(str)
Script help for 'triggerserver':
Clientside:
triggerserver(str, str)

xAndrewx 09-19-2010 09:43 PM

Quote:

Originally Posted by Chompy (Post 1601508)
Use a ganiscript :) No need to trigger then

I wouldn't, I rather just send one triggeraction when the songs finished instead of sending every player an attr flag containing the same information inside the same level.

Quote:

Originally Posted by Mark Sir Link (Post 1601510)
Script help for 'triggerclient':
triggerclient(str)
TServerPlayer.triggerclient(str)
Script help for 'triggerserver':
Clientside:
triggerserver(str, str)

?????

Chompy 09-19-2010 10:01 PM

Quote:

Originally Posted by xAndrewx (Post 1601515)
I wouldn't, I rather just send one triggeraction when the songs finished instead of sending every player an attr flag containing the same information inside the same level.

Instead of triggering all players on the server you could just make the client (player) listen (monitor) a variable (for example serverr.radiosong).

I also take back what I said about gani scripts, I misread the OP's post. I still stand by what I said above though.

cbk1994 09-19-2010 10:28 PM

Quote:

Originally Posted by Mark Sir Link (Post 1601510)
Script help for 'triggerclient':
triggerclient(str)
TServerPlayer.triggerclient(str)
Script help for 'triggerserver':
Clientside:
triggerserver(str, str)

Are you honestly surprised that Graal's documentation is inaccurate?

Mark Sir Link 09-20-2010 08:46 AM

Quote:

Originally Posted by cbk1994 (Post 1601517)
Are you honestly surprised that Graal's documentation is inaccurate?

what do you mean, I am using triggerclient(this.name, params) in several scripts with no issue

I actually didn't know triggerclient would work if "gui" or "weapon" was passed along as a param.

cbk1994 09-20-2010 12:45 PM

Quote:

Originally Posted by Mark Sir Link (Post 1601603)
what do you mean, I am using triggerclient(this.name, params) in several scripts with no issue

I actually didn't know triggerclient would work if "gui" or "weapon" was passed along as a param.

Annoyingly, both seem to work now that I've actually checked x_x.

Gscript is such an awful language.

Dnegel 09-20-2010 07:27 PM

Quote:

Originally Posted by cbk1994 (Post 1601611)
Gscript is such an awful language.

Careful now.. :asleep:

Chompy 09-21-2010 12:24 AM

Quote:

Originally Posted by Dnegel (Post 1601651)
Careful now.. :asleep:

I fully agree with Chris though x)

Deas_Voice 09-21-2010 10:18 AM

Quote:

Originally Posted by Chompy (Post 1601696)
I fully agree with Chris though x)

we all do x)

Seeya 09-23-2010 03:29 AM

Quote:

Originally Posted by cbk1994 (Post 1601517)
Are you honestly surprised that Graal's documentation is inaccurate?

no you're wrong graal can't be wrong

kale when did u learn 2 script get out of npc scripting sub-forums

Supaman771 09-23-2010 09:51 PM

Quote:

Originally Posted by Seeya (Post 1602065)
no you're wrong graal can't be wrong

kale when did u learn 2 script get out of npc scripting sub-forums

You guys are ***s.


All times are GMT +2. The time now is 09:19 AM.

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