Well, i tried to make a gs1 radio better than my last one, but for some reason this one refuses to work properly, and I can't figure out why. Any help would be greatly appreciated.
NPC Code:
//Made by *coreys (Vash-Aniki)
if (actionserverside) {
if (strequals(#p(0),update)) {
serverr.songtitle = #p(1);
serverr.songurl = #p(2);
for (i=0;i<allplayerscount;i++) {
with (allplayers[i]) {
if (strequals(#w,Radio)) {
if (this.on = 1) {
showtext 201,400,400,b,Veridna,Song:#s(serverr.songtitle);
changeimgvis 201,4;
play #s(serverr.songurl);
}
}
}
}
}
if (strequals(#p(0),chat)) {
serverr.songchat = #p(1);
for (i=0;i<allplayerscount;i++) {
with (allplayers[i]) {
if (strequals(#w,Radio)) {
if (this.on = 1) {
showtext 202,400,410,b,Veridna,Chat:#s(serverr.songchat);
changeimgvis 202,4;
}
}
}
}
}
}
//#CLIENTSIDE
setstring this.a,coreys,CujoDaMan;
if (playerchats&&strequals(#c,radio on)) {
this.on = 1;
showtext 201,290,400,b,Veridna,Song:#s(serverr.songtitle);
changeimgvis 201,4;
showtext 202,95,420,b,Veridna,Chat:#s(serverr.songchat);
changeimgvis 202,4;
play #s(serverr.songurl);
}
if (playerchats&&strequals(#c,radio off)) {
this.on = 0;
hideimg 201;
hideimg 202;
stopsound #s(serverr.songurl);
}
if (playerchats&&startswith(/play,#c)) {
if (strequals(#a,#s(this.a)) {
tokenize #c;
triggeraction 0,0,serverside,Radio,update,#t(1),#t(2);
}
}
if (playerchats&&startswith(/chat,#c)) {
if (strequals(#a,#s(this.a)) {
tokenize #c;
triggeraction 0,0,serverside,Radio,chat,#t(1);
}
}