![]() |
showing GUI for all players
according to my understanding, GUI's are clientside. i've been scratching my head for a while on how I could show a specific GUI for all players no matter where they are on the server.
In a specific level, a staff player chats "/commands" to bring up a GUI which has buttons with commands. On one of the buttons, he can click on it and it should show a GUI at the upper right hand corner of the screen for everyone on the server. This new GUI which appears has a button that allows players to click on it to warp into the room. This is like an event warper. I have the actual code in a CLASS and the CLASS is attached to an NPC in a level using the "join" function: join staffcommand; The script is around 500-700 lines of codes, so I don't think i'll post the code here. I'm just curious on how to get the GUI to show for everyone on the server if this is possible. |
What you would do, is triggerserver in the weapon(this is for the person starting the warp thing), and then triggerclient all the players to display the GUI.
|
can you show an example? i tried it before, but couldn't get it to work:
PHP Code:
|
I don't know GS2 well enough, and I don't remember much about serverside.
But it'd be something like: PHP Code:
|
Nice try Dusty, but I recommend going with this instead:
PHP Code:
EDIT: Make sure all players actually have the wNPC! |
Quote:
You don't need the "gui" while using triggerclient, or at least I've never used it and don't know if it makes a difference or not. I've always done: PHP Code:
|
the thing is that this isn't a weapon. it's an NPC script attached to an actual NPC in a level, so i still can't get this to work.
|
Quote:
You can't triggerclient in level NPCs, you'd have to use attr[]'s to communicate from server to client. |
can you post a simple example for me to work on?
|
Quote:
Just assign attr[] variables on the server. In the brackets, you put a number. attr[1] is automatically pre-defined for the player's hat, so you won't be able to use that. I believe attr[]'s go up to 30 or so. You can just do something like PHP Code:
on the serverside, and you'll be able to read attr[10] on the clientside. |
just curious if it is it possible to attach a class to every single level in a server through a script or do i have to manually edit every single level and attach "join class"; to an NPC??
|
Why not just make it a WNPC in that case?
|
//ActionServerSide Stuff
for (i=0;i<allplayerscount;i++) { with (allplayers[i]){ //Insert The GUI Code Here }} //ClientSide Stuff |
Did anyone notice he used triggerserver wrong? O.o
|
| All times are GMT +2. The time now is 05:05 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.