Ulysses

General => Developers Corner => Topic started by: koaandl on October 08, 2009, 10:07:12 PM

Title: Custom Admin Bot
Post by: koaandl 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?
Title: Re: Custom Admin Bot
Post by: Megiddo on October 09, 2009, 05:23:18 AM
Remove the "return text" line.
Title: Re: Custom Admin Bot
Post by: koaandl on October 09, 2009, 05:24:43 AM
thanks Megiddo :) (btw, I LOVE YOUR ADDONS MAN! YOU ARE THE BEST MOD MAKER EVER!)
Title: Re: Custom Admin Bot
Post by: JamminR on October 09, 2009, 04:01:45 PM
We thank you for your support