Author Topic: Custom Admin Bot  (Read 2820 times)

0 Members and 1 Guest are viewing this topic.

Offline koaandl

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Custom Admin Bot
« on: October 08, 2009, 10:07:12 PM »
Hi guys! I'm making a script for my server that acts as a computerised admin to control the server when there is no admins on. it works around players messaging the bot and it will do things for them. I have this

Code: [Select]
Time = "ply:TimeConnected"
function playerRespawn( ply )
  for a, b in pairs(player.GetAll()) do
b:PrintMessage( HUD_PRINTCENTER, "The server has detected that player: " .. ply:GetName() .. " has been rebirthed: Welcome to life." )
end
end

function ISaid( ply, text, toall )
    if (string.sub(text, 1, 7) == "/noclip") then
        if (Time > 600) then
        ply:SetMoveType(MOVETYPE_NOCLIP)
        end
        if (Time < 599) then
        ply:SendHint( "You have not played long enough to use NoClip!",5)
        end
    end
    if (string.sub(text, 1, 4) == "/nco") then
       ply:SetMoveType(MOVETYPE_WALK)
    end
    return text;
end

hook.Add( "PlayerSpawn", "playerRespawnWelkommen", playerRespawn );
hook.Add( "PlayerSay", "ISaid", ISaid );

When using this on the server, the ULX menu becomes disabled (using any command like !ulx or !menu does not work), and then this one (the /noclip) doesnt work either. I assume it does that because the two playersay hooks (from ULX and this) are conflicting. Is there a way i can somehow implement this into the server without having to have ULX disable itself?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Custom Admin Bot
« Reply #1 on: October 09, 2009, 05:23:18 AM »
Remove the "return text" line.
Experiencing God's grace one day at a time.

Offline koaandl

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
Re: Custom Admin Bot
« Reply #2 on: October 09, 2009, 05:24:43 AM »
thanks Megiddo :) (btw, I LOVE YOUR ADDONS MAN! YOU ARE THE BEST MOD MAKER EVER!)

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Custom Admin Bot
« Reply #3 on: October 09, 2009, 04:01:45 PM »
We thank you for your support
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming