Graal Forums

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

coreys 05-06-2005 03:23 AM

GS1 Radio help
 
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);
}
}


StanislavHunter 05-06-2005 04:55 AM

Once again... your NPC works.

coreys 05-06-2005 03:21 PM

=]

Kaimetsu 05-06-2005 11:22 PM

Do I even need to say it? :|

coreys 05-06-2005 11:36 PM

Nope, although if you could actually once point out what I do wrong, that would be nice. Considering I've read your KSI-GS.

Kaimetsu 05-06-2005 11:43 PM

Quote:

Originally Posted by coreys
Nope, although if you could actually once point out what I do wrong, that would be nice. Considering I've read your KSI-GS.

You're breaking rules 1, 2A, 5 and 8.

Also, you're using strequals to check if a string is in a list. This won't work.
Furthermore, you're using presentational commands (showtext etc) on the serverside. This won't work.
Lastly, you're only checking security info on the clientside. This is poor security.


All times are GMT +2. The time now is 06:16 AM.

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