Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-24-2010, 03:10 PM
pez307 pez307 is offline
ImThatGuy
pez307's Avatar
Join Date: Apr 2007
Posts: 58
pez307 is an unknown quantity at this point
Help?

Hi i've been tinkering with Chris's script he posted on forums, i edited the script with a new GUI but it's not opening.. I have no Errors come up everything seems to be in good working order but soon as i press R doesn't work, it doesn't work. Then i decided to add Chris's script Non-Edited and it still never worked...

Script:
NPC Code:
//#CLIENTSIDE 
function onCreated()
{
show();
}
function onKeyPressed( code, key )
{
if ( key == "r" )
{
setTimer( 0.05 );
Pez_Window2.visible = Pez_Window2.visible - 1;
GraalControl.makeFirstResponder( true );
}
}
function onWeaponFired()
{
say2( "Press 'r' to toggle Music Player" );
}
function show()
{
playing = this.playing;
Pez_Window2.destroy();
new GuiWindowCtrl( "Pez_Window2" )
{
profile = "GuiBlueWindowProfile";
width = 280;
height = 120;
x = screenwidth - width;
y = screenheight - height;
canClose = canMinimize = true;
canMaximize = canResize = false;
visible = false;
text = "Music Player for" SPC servername;
useownprofile = true;
profile.transparency = .9;
new GuiMLTextCtrl( "Pez_Text1" )
{
profile = "GuiBlueTextProfile";
x = 10;
y = 30;
width = 270;
height = 20;
useownprofile = true;
profile.align = "center";
text = "<center>Now playing:" SPC playing;
}
new GuiPopUpMenuCtrl( "Pez_Popup1" )
{
profile = "GuiBluePopUpMenuProfile";
width = 260;
height = 20;
x = 10;
y = 50;
textprofile = "GuiBlueTextListProfile";
scrollprofile = "GuiBlueScrollProfile";
clearRows();
temp.music = {
{ "SONG_NAME", "SONG_URL" },
{ "SONG2_NAME", "SONG2_URL" }
};
for ( temp.i = 0; temp.i < temp.music.size(); temp.i ++ )
{
with( addRow( 0, temp.music[temp.i][0] ) )
{
this.var = temp.music[temp.i][1];
}
}
setSelectedRow( 0 );
sort();
}
new GuiButtonCtrl( "Pez_Button1" )
{
profile = "GuiBlueButtonProfile";
width = 75;
height = 30;
x = Pez_Window2.width / 2 - ( width / 2 );
y = Pez_Window2.height - 40;
text = "Stop Music";
}
}
stopmidi();
this.playing = "[None]";
Pez_Text1 = "Now playing: [None]";
}
function onTimeOut()
{
this.time += .05;;
setTimer( 0.05 );
}
function Pez_Button1.onAction()
{
stopmidi();
this.playing = "[None]";
Pez_Text1 = "Now playing: [None]";
}
function Pez_Popup1.onSelect()
{
if ( this.time > 0 )
{
this.playing = params[1];
Pez_Text1.text = "Now playing:" SPC params[1];
play( Pez_Pupup1.rows[params[2]].var );
}
}
function onPlay( title, song )
{
this.playing = title;
Jukebox_Text.text = "Now playing:" SPC title;
play( song );
}



Anybody know what's wrong? Help would be appretiated.
__________________
Cm*

Last edited by pez307; 08-24-2010 at 03:34 PM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:01 AM.


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