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 03-18-2002, 06:08 AM
reeset1 reeset1 is offline
Registered User
Join Date: Jan 2002
Posts: 112
reeset1 is on a distinguished road
Send a message via AIM to reeset1 Send a message via Yahoo to reeset1
Talking On-screen Jukebox

NPC Code:

//superkewl musix k?
//Made by Reese
//Steal it and die
//Use it on your server and die
//Offline only K?
//Currently Holds 20 songs! OMI
if(playerenters){
toweapons On-screen Jukebox;
}
if(playerchats&&startswith(add song,#c)){
tokenize #c;
setstring songtitle,#t(3);
setstring songfile,#t(4);
setstring songtype#t(2),#t(5);
setstring songfile#t(2),#s(songfile);
setstring songtitle#t(2),#s(songtitle)(#s(songfile#t(2))).#s (songtype#t(2));
setstring songfile,;
setstring songtitle,;
}


if(weaponfired){
showstats 1024;
this.on=1;
this.on2=1;
this.move=0;
disabledefmovement;
setminimap ,,,;
timeout=0.05;
}
if(timeout){
if(this.on=1){
//Song Column
showimg 400,@Songs(Filename.Type),35,80;
changeimgvis 400,4;
changeimgzoom 400,0.8;

showimg 403,@1.#s(songtitle1),35,110;
changeimgvis 403,4;
changeimgzoom 403,0.8;

showimg 404,@2.#s(songtitle2),35,125;
changeimgvis 404,4;
changeimgzoom 404,0.8;

showimg 405,@3.#s(songtitle3),35,140;
changeimgvis 405,4;
changeimgzoom 405,0.8;

showimg 406,@4.#s(songtitle4),35,155;
changeimgvis 406,4;
changeimgzoom 406,0.8;

showimg 407,@5.#s(songtitle5),35,170;
changeimgvis 407,4;
changeimgzoom 407,0.8;

showimg 408,@6.#s(songtitle6),35,185;
changeimgvis 408,4;
changeimgzoom 408,0.8;

showimg 409,@7.#s(songtitle7),35,200;
changeimgvis 409,4;
changeimgzoom 409,0.8;

showimg 410,@8.#s(songtitle8),35,215;
changeimgvis 410,4;
changeimgzoom 410,0.8;

showimg 411,@9.#s(songtitle9),35,230;
changeimgvis 411,4;
changeimgzoom 405,0.8;

showimg 412,@10.#s(songtitle10),35,245;
changeimgvis 412,4;
changeimgzoom 412,0.8;

showimg 413,@11.#s(songtitle11),35,260;
changeimgvis 413,4;
changeimgzoom 413,0.8;

showimg 414,@12.#s(songtitle12),35,275;
changeimgvis 414,4;
changeimgzoom 414,0.8;

showimg 415,@13.#s(songtitle13),35,290;
changeimgvis 415,4;
changeimgzoom 415,0.8;

showimg 416,@14.#s(songtitle14),35,305;
changeimgvis 416,4;
changeimgzoom 416,0.8;

showimg 417,@15.#s(songtitle15),35,320;
changeimgvis 417,4;
changeimgzoom 417,0.8;

showimg 418,@16.#s(songtitle16),35,335;
changeimgvis 418,4;
changeimgzoom 418,0.8;

showimg 419,@17.#s(songtitle17),35,350;
changeimgvis 419,4;
changeimgzoom 419,0.8;

showimg 420,@18.#s(songtitle18),35,365;
changeimgvis 420,4;
changeimgzoom 420,0.8;

showimg 421,@19.#s(songtitle19),35,380;
changeimgvis 421,4;
changeimgzoom 421,0.8;

showimg 422,@20.#s(songtitle20),35,395;
changeimgvis 422,4;
changeimgzoom 422,0.8;

showimg 423,@Stop,35,410;
changeimgvis 423,4;
changeimgzoom 423,0.8;

showimg 424,@Help:Say "help" to learn how operate this.,300,85;
changeimgvis 424,4;
changeimgzoom 424,0.8;
}
//Movement
if (keydown(0) || keydown(2)) {
if (this.down==0) {
if (keydown(0)) {this.move-=1;}
if (keydown(2)) {this.move+=1;}
this.down = 1;
}
} else {
this.down = 0;
}
if (this.move<0) {this.move = 0;}
if (this.move>20) {this.move = 20;}
showimg 401,@->,25,110+(this.move*15);
changeimgvis 401,4;
changeimgzoom 401,0.8;
timeout=0.05;

}
if(keydown(5)&&!this.move=20){
setstring currentlyplaying,#s(songfile#v(this.move+1)).#s(so ngtype#v(this.move+1));
play #s(songfile#v(this.move+1)).#s(songtype#v(this.mov e+1));
}
else
stopsound #s(currentlyplaying);

//Help
if(playerchats&&strequals(#c,help)){
say2 This will explain how to use#b
the On-Screen Jukebox. To add#b
a new song, simply say:#b
add song "s" "n" "f" "t".#b
Now to explain what those mean.#b
"s" is the slot number that#b
the song will be stored to.#b
"n" is the title you give to#b
the song you are adding. If#b
you use spaces, use quotations ""#b
around it the whole name.#b
"f" is the actual filename of#b
the song. It must be located#b
in a folder in the main Graal#b
folder. DO NOT ADD THE EXTENSION.#b
"t" is the file type/extension.#b
If the file was a midi, it would#b
be like this: "mid".
Example:#b
add song "1" "Cool" "coolsong" mid#b
This would ad the song called Cool#b
to slot 1. I hope this explains#b
everything.;
}



There are a few bugs, and I have not fixed the stop command and making it so you can exit it but you can still see how purdy it looks =)
[edit] I do realize how much I could shorten this up but I was in a hurry[/edit]
__________________
---
Reese is no longer the (Events Admin)
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 11:04 PM.


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