![]() |
for allplayers
Alright, so I have made a little mass message GUI and I have a quick question.
Since it is being sent to everyone, does "for (temp.pl: allplayers)" get all of the players on the server or just local players in the same level? Also, here is the code im using. How can I improve it? Thanks :D PHP Code:
Edit: Also, in this part of the code: PHP Code:
Thank you |
"allplayers" references all the players on a server. "players" references all the players in a level the script is being run from.
I'll leave any code tweaking suggestions to fowlplay4 who will undoubtedly end up reading this thread. |
allplayers is full of player objects, not their account names. You're using them like accounts right now though. My suggestions packed into code:
PHP Code:
I didn't touch the clientside part, but word of advice: don't recreate the GUI objects all the time. Create them once and then hide/show them. |
Crow's spot on from fixing your existing code.
Using (npcserver) PM's for mass messages suck and if everyone can do it, it'll just become a nuisance to the point people are ignoring the (npcserver). There might be a function to open a mass message window but this also works: PHP Code:
|
Thank you for the advice guys :)
|
It basically means:
1. Create the GUI when the weapon is created. 2. Set the visibility of the GUI to false Then when you want to display the GUI just call show() or make it visible. I.e: PHP Code:
|
| All times are GMT +2. The time now is 03:02 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.