Graal Forums

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

alissalee 08-17-2005 06:45 AM

Radio help
 
How can i make this script change Radio Stations or script a radio changer part to it
NPC Code:

//Copyright© 2005 Vash-Aniki(*coreys)
//Donated to Reborn (Playerworld14) to Jay
if (actionserverside) {
if (strequals(#p(0),play)) {
setstring serverr.radiotitle,#p(1);
setstring serverr.radiosong,#p(2);
setstring serverr.radiodj,#p(3);
setstring serverr.djhead,#p(4);
}
if (strequals(#p(0),chat)) {
setstring serverr.radiochat,#p(1);
}
}
//#CLIENTSIDE
if (weaponfired) {
if (this.on==0) {
this.on = 1;
setplayerprop #c,Radio Connected!;
} else {
this.on = 0;
setplayerprop #c,Radio Disconnected!;
hideimgs 200,1030;
stopmidi;
}
}
if (timeout && this.on == 1) {
play #s(serverr.radiosong);
showtext 1002,40,105,arial,,DJ: #s(serverr.radiodj);
changeimgvis 1002,5;
showtext 1004,40,115,arial,,Song: #s(serverr.radiotitle);
changeimgvis 1004,5;
showtext 1005,40,125,arial,,Chat: #s(serverr.radiochat);
changeimgvis 1005,5;
} timeout =.05;
if (playerchats) {
if (strequals(#a,alissalee)) {
if (startswith(/play,#c)) {
tokenize #c;
triggeraction 0,0,serverside,Misc/Radio,play,#t(1),#t(2),#n,#3;
}
if (startswith(/chat,#c)) {
triggeraction 0,0,serverside,Misc/Radio,chat,#T(#e(5,-1,#c));
}
if (startswith(/channel 2,#c)) {
triggeraction 0,0serverside,Misc/Radio,station1,#T
//Copyright© 2005 Vash-Aniki(*coreys)
if (actionserverside) {
if (strequals(#p(0),play)) {
setstring serverr.radiotitle,#p(1);
setstring serverr.radiosong,#p(2);
setstring serverr.radiodj,#p(3);
setstring serverr.djhead,#p(4);
}
if (strequals(#p(0),chat)) {
setstring serverr.radiochat,#p(1);
}
}


//#CLIENTSIDE
if (weaponfired) {
if (this.on==0) {
this.on = 1;
setplayerprop #c,Radio Connected!;
} else {
this.on = 0;
setplayerprop #c,Radio Disconnected!;
hideimgs 200,1030;
stopmidi;
}
}
if (timeout && this.on == 1) {
play #s(serverr.radiosong);
showtext 1002,40,105,arial,,DJ: #s(serverr.radiodj);
changeimgvis 1002,5;
showtext 1004,40,115,arial,,Song: #s(serverr.radiotitle);
changeimgvis 1004,5;
showtext 1005,40,125,arial,,Chat: #s(serverr.radiochat);
changeimgvis 1005,5;
} timeout =.05;
if (playerchats) {
if (strequals(#a,alissalee)) {
if (startswith(/play,#c)) {
tokenize #c;
triggeraction 0,0,serverside,Misc/Radio,play,#t(1),#t(2),#n,#3;
}
if (startswith(/chat,#c)) {
triggeraction 0,0,serverside,Misc/Radio,chat,#T(#e(5,-1,#c));
}
}
}
}
}
}


Bl0nkt 08-17-2005 07:32 PM

The serverr. strings need to include different radio stations.

Example:

serverr.radioA,strings;
serverr.radioB,strings;

Then add variables for switching the channels.

NPC Code:
if (weaponfired) {
if (this.stationnumber == 0) {
this.stationnumber = 1;
timeout = .05;
}else
if (this.stationnumber == 1) {
this.stationnumber = 2;
}timeout = .05;
}


Then put small areas distinguishing what each variable does.

NPC Code:
if (timeout) {
if (this.stationnumber == 1) {

[Insert the script to show the text of the current song and such]

}
}


Just keep your mind to it.

alissalee 01-06-2006 02:38 PM

ok i did that how would i make a channle changer for it i made a gui for it and i did some updates to make it move when u are lising to it i meaning the text so could u help me wit this one more part

Skyld 01-06-2006 03:36 PM

Scripting Forum Rules, rule 1:
Quote:

Don't post here just asking for scripts, or asking for people to fix scripts that are beyond your skill level. The posters here aren't just some handy resource for scripting shortcuts. If you can't script something then don't try to produce it. If you're trying to make it to aid your learning then set your sights lower. If you want it for a server then go hire a scripter.


All times are GMT +2. The time now is 10:10 PM.

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