Author Topic: Admin Joined Script  (Read 1516 times)

0 Members and 1 Guest are viewing this topic.

Offline cynicle

  • Major(1)
  • Posts: 37
Admin Joined Script
« on: May 17, 2007, 09:57:10 am »
Hey, sorry that I sound noob (which I am when it comes to scripting) but I was wondering if anyone could help me by compiling me a script which notifies everyone on the server when an admin has joined (I run a server in Aus). Thats it really. If anyone could do that and give a few instructions on lines to add to all the .pas files to run it i'd be very gratfull.

Thanks
Cynicle
Join the Army. Visit strange and exotic places. Meet fascinating people. And kill them.

Aus Soldat League 203.208.70.216:23073

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Admin Joined Script
« Reply #1 on: May 17, 2007, 10:28:03 am »
On ARSSE it would be:
OnPlayerJoin:

if $PLAYER_IP = admin1ip
/say Watch out, admin joined!
endif


if $PLAYER_IP = admin2ip
/say Watch out, admin joined!
endif

Offline KeYDoN

  • Major
  • *
  • Posts: 60
Re: Admin Joined Script
« Reply #2 on: May 17, 2007, 10:37:36 am »
well the easy solution at soldatscript is to check the clantag.
the other would be to search in the remote.txt for the ip of all joining ppl ^^

Code: [Select]
network.pas:

procedure OnJoinGame(ID, Team: byte);
begin
 if MaskCheck(IDtoName(ID),'*SAMPLE-CLAN-TAG*') then WriteConsole(0, 'Admin joined!', $FFF5D521);
end;

keep the * around the tag^^
« Last Edit: May 17, 2007, 10:39:55 am by KeYDoN »

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Admin Joined Script
« Reply #3 on: May 17, 2007, 11:28:24 am »
Have NOT tested this. But it should work.
Code: [Select]
procedure OnJoinGame(ID, Team: byte);
begin
if ContainsString(ReadFile('remote.txt'),GetPlayerStat(ID,'ip')) then WriteConsole(0, 'Admin joined!', $FFF5D521);
end;
« Last Edit: May 17, 2007, 11:53:26 am by mikembm »

Offline iftach

  • Major(1)
  • Posts: 16
Re: Admin Joined Script
« Reply #4 on: May 17, 2007, 11:39:55 am »
Why would mapslist.txt contain the ip?

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Admin Joined Script
« Reply #5 on: May 17, 2007, 11:53:55 am »
LOL. I copied and pasted the function and forgot to change to remote.txt - changed now

Offline cynicle

  • Major(1)
  • Posts: 37
Re: Admin Joined Script
« Reply #6 on: May 18, 2007, 04:52:07 am »
Thanks guys i'll try those out and see which works best for my server.

Originally with ARSSE i tried

OnAdminJoin
/say Admin has joined!

anyone know why this doesnt work? Im guessing OnAdminJoin is activated when someone connect with ARSSE not ingame admin am i correct?

Date Posted: May 18, 2007, 05:44:44 am
mikembm your script doesn't seem to work. I like the theory behind how it works so I chose to go with it, and i get no errors but it doesn't display anything when I join the server. Yeh and I did check my IP was in the remote.txt
Join the Army. Visit strange and exotic places. Meet fascinating people. And kill them.

Aus Soldat League 203.208.70.216:23073

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Admin Joined Script
« Reply #7 on: May 18, 2007, 04:15:54 pm »

Originally with ARSSE i tried

OnAdminJoin
/say Admin has joined!

anyone know why this doesnt work? Im guessing OnAdminJoin is activated when someone connect with ARSSE not ingame admin am i correct?
There's no function like OnAdminJoin, there's OnAdminConnect. Yes, this event is activated when admin connects to the server via admin tool.

Offline Quantifier

  • Major
  • *
  • Posts: 70
Re: Admin Joined Script
« Reply #8 on: May 18, 2007, 05:36:08 pm »
Have NOT tested this. But it should work.
Code: [Select]
procedure OnJoinGame(ID, Team: byte);
begin
if ContainsString(ReadFile('remote.txt'),GetPlayerStat(ID,'ip')) then WriteConsole(0, 'Admin joined!', $FFF5D521);
end;
That's not the best idea, it will grind on the disk every time anyone joins. Better read the file once at the beginning, and put it for later use in some global variable.