Re: Request: Events UI
Thanks, man. I'll see if I can pick it apart and make it work for me.
I tweaked it to work on my UI's timeout and to shut itself off after two minutes. Originally, I would have to re-enter the level for the events UI to update to a different event or being shut off. But I tweaked it a bit more to be completely active.
I put this as my event setter. I found it easier to use those pre-made strings. I tossed a sleep command in there for my time till the event joining is over.
// NPC made by Koroshiya&&Handuponyohip
if (playertouchsme) {
toweapons Staff/Event Setter;
}
if (playerchats && startswith(/event off,#c)){
replacestring server.events,0,no;
replacestring server.events,1,;
replacestring server.events,2,;
replacestring server.events,3,;
}
if (playerchats && startswith(/event ctf,#c)){
replacestring server.events,0,yes;
replacestring server.events,1,Capture The Flag;
replacestring server.events,2,events_ctf.nw;
replacestring server.events,3,3 Event Coins;
sleep 120;
replacestring server.events,0,no;
replacestring server.events,1, ;
replacestring server.events,2, ;
replacestring server.events,3, ;
}
And I added this to my System NPC. Again, relying on the timeout set by my HUD. I added another timeout condition that if events0 is no, to hide the events UI. This added functionality for my timer and the ability to toggle the UI on an off.
if (timeout&&strequals(#I(server.events,0),yes)){
showimg 510,nyght_ui_events.png,this.screenposition[0]+340,this.screenposition[1]+410;
showimg 511,@ariel@center@#I(server.events,3),this.screenposition[0]+450,this.screenposition[1]+446;
showimg 512,@ariel@center@#I(server.events,1),this.screenposition[0]+450,this.screenposition[1]+421;
changeimgvis 510,4;
changeimgvis 511,4;
changeimgvis 512,4;
timeout=0.05;
}
if (timeout&&strequals(#I(server.events,0),no)) {
hideimgs 510,512;
}
if (actionleftmouse) {
setlevel #I(server.events,2);
hideimgs 510,512;
}
Thanks, again, for your help. I've never really pressed the issue of using strings, but the gears are really turning now that I believe I have a grasp on them. Kudos.
(Sidenote: We really need a reputation add-on. lol)