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
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Scripting an on/off radio

As far as turning the radio on/off goes, you can try something like this:

PHP Code: (Select All)
void OnStart()
{
   
SetLocalVarInt("RadioOn",0);
   
SetEntityPlayerInteractCallback("radioarea","Radio",false);
}

void Radio(string &in AsEntity)
{
    
    if(
GetLocalVarInt("RadioOn") == 0)
    {
         
//Play sound etc
    
AddDebugMessage("Radio on",false);
    
SetLocalVarInt("RadioOn",1);
    }
        
        else
        {
                        
//Stop sound etc etc
            
AddDebugMessage("Radio off",false);
            
SetLocalVarInt("RadioOn",0);
        }


That *should* work.
(This post was last modified: 05-03-2013, 06:54 PM by Tomato Cat.)
05-03-2013, 06:45 PM
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 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)