Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Admin Message System (https://forums.graalonline.com/forums/showthread.php?t=134264583)

Gunderak 09-18-2011 10:32 AM

Admin Message System
 
I know its fairly simple, but still useful.
Any feedback is appriciated.
PS: for players to broadcast there account needs to be in this.allowed.

PHP Code:

function onActionServerSide() {
  if (
params[0] == "send") {
    for (
temp.plallplayers) {
      
temp.pl.triggerclient(this.name"recieved"params[1]);
    }
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.allowed = {
    
"Graal780374"
  
};
}

function 
ChatBar.onAction() {
  if (
ChatBar.text.starts("/adminmessage")) {
    if (
player.account in this.allowed) {
      
triggerserver("weapon"this.name"send"ChatBar.text.substring(14));
      
shared.chat("");
    }
  }
}

function 
onActionclientside() {
  if (
params[0] == "recieved") {
    
shared.adminMessage("<center><b><font size=15>Broadcast Message</b></font><br><font size=14>" params[1]);
  }



Twinny 09-18-2011 11:37 AM

That account check really should be serverside...

Gunderak 09-18-2011 12:01 PM

Yeah so that haxors cant change it using memory editors, forgot to do that.

cbk1994 09-18-2011 06:39 PM

Besides the serverside check, onActionclientside should be onActionClientSide and recieved should be spelled correctly (received). Those are the only issues I see, nice work.

Gunderak 09-19-2011 09:49 AM

LOL i mispelt received. oh how dumb i feel.
and does the capitalization of onActionClientSide actually affect anything?

cbk1994 09-19-2011 09:59 PM

Quote:

Originally Posted by Gunderak (Post 1668588)
LOL i mispelt received. oh how dumb i feel.
and does the capitalization of onActionClientSide actually affect anything?

No, it's only for consistency.


All times are GMT +2. The time now is 06:52 PM.

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