Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-17-2005, 06:45 AM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
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));
}
}
}
}
}
}

Reply With Quote
  #2  
Old 08-17-2005, 07:32 PM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
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.
Reply With Quote
  #3  
Old 01-06-2006, 02:38 PM
alissalee alissalee is offline
Mr. Ciprioni Atrius Admin
alissalee's Avatar
Join Date: Dec 2004
Location: Lawrence, Ma
Posts: 190
alissalee is an unknown quantity at this point
Send a message via AIM to alissalee Send a message via MSN to alissalee
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
__________________
account was being used by jigga.... sorry for what he has said in the past
Reply With Quote
  #4  
Old 01-06-2006, 03:36 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
__________________
Skyld
Reply With Quote
Reply


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 12:05 PM.


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