Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting an on/off radio
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#3
RE: Scripting an on/off radio

PHP Code: (Select All)
void OnStart()

{

SetLocalVarInt("Radio"1); //The VarInt that makes it to go ON/OFF. 1 = OFF, 0 = ON
PreloadSound("radio.snt"); //Preloaded sound.

SetEntityPlayerInteractCallback("PlayerInteract""RadioPlay"false); //SEPIC have three arguments, not five.

}



void Radio(string &in asEntity//You had the wrong syntax.

{
  if(
GetLocalVarInt("Radio") == 0)
  {
   
PlaySoundAtEntity("""radio.snt""radioarea"0.0false);
  }
  
  else
  {
  
StopSound("radio.snt"0.5f); //Change 0.5f to how long you want the sound to fade out.
  
}



"Veni, vidi, vici."
"I came, I saw, I conquered."
05-04-2013, 12:58 AM
Find


Messages In This Thread
Scripting an on/off radio - by Kalidus - 05-03-2013, 05:48 PM
RE: Scripting an on/off radio - by Tomato Cat - 05-03-2013, 06:45 PM
RE: Scripting an on/off radio - by Kalidus - 05-04-2013, 07:13 PM
RE: Scripting an on/off radio - by PutraenusAlivius - 05-04-2013, 12:58 AM
RE: Scripting an on/off radio - by Daemian - 05-04-2013, 10:44 AM
RE: Scripting an on/off radio - by Daemian - 05-04-2013, 10:56 PM
RE: Scripting an on/off radio - by Tomato Cat - 05-04-2013, 07:20 PM
RE: Scripting an on/off radio - by Tomato Cat - 05-04-2013, 08:36 PM
RE: Scripting an on/off radio - by Kalidus - 05-04-2013, 10:57 PM
RE: Scripting an on/off radio - by Daemian - 05-05-2013, 05:10 AM



Users browsing this thread: 1 Guest(s)