Author Topic: Simple In-Game Admin Greet  (Read 1573 times)

0 Members and 1 Guest are viewing this topic.

Offline Bellamy

  • Major(1)
  • Posts: 42
Simple In-Game Admin Greet
« on: July 01, 2008, 12:40:06 pm »
Script Name: Admin Greet
Script Description: When an admin logs into the server (in-game), a message greets him/her. (it also reads the password from Soldat.ini to check if it is right or not)
Original Author(s): Bellamy
Core Version: 2.6.3

*FIXED*



Code: [Select]
function OnPlayerCommand(ID: byte; Text: string): boolean;
begin
    if Text = '/adminlog '+ReadINI('soldat.ini','NETWORK','Admin_Password','*ERROR*') then begin
        WriteConsole(0,'Server admin ' + IDToName(ID) + ' has just logged in!',$FF0000);
    end;
end;



Just a simple script for lazy admins. (reffering to the "how it reads the password for you" part of it)
« Last Edit: July 02, 2008, 01:10:04 am by Bellamy »

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: Simple In-Game Admin Greet
« Reply #1 on: July 01, 2008, 01:01:40 pm »
OnCommand is only called when an admin types something, why would an admin type /adminlog ?
why would you show adminpw to an admin when he types a command?
and of course /adminlog already checks if the admin pw is right :S

other than that, awesome script

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Simple In-Game Admin Greet
« Reply #2 on: July 01, 2008, 01:33:05 pm »
Heh, i suggest you to improve the script cause , in my opinion, it's a little. Continue on your script!
Remember: Practice makes perfect, so good luck!

Offline Bellamy

  • Major(1)
  • Posts: 42
Re: Simple In-Game Admin Greet
« Reply #3 on: July 02, 2008, 12:57:19 am »
Thanks for not getting mad about the script not being well written. I'm guessing you read that I am a beginer at scripting.  ;)

Well I worked on it a little bit more and I posted the new version.

Holdja horses BombSki.

I know it's supposed to be 'function' and not 'procedure'.
I know /adminlog reads soldat.ini to see if you have the right password.
If I didn't make it read soldat.ini then you would have to put a password.
If I put a password, you would have to change it and if I/you wanted a new pass, then you would have to go back and change it again.
So therefore, this script is for lazy people like me and I'm right.
Deal with it.

P.S. - You may think I know nothing about scripting.. Oh.. I do..
P.S. #2 - But you are right about the part where it tells you what your own password is. I fixed that.
« Last Edit: July 03, 2008, 12:11:43 pm by Bellamy »