• Need a little help on a DarkRP kinda "function"...
    3 replies, posted
So,Basicly I need a little help on creating a custom command,I know what I want its just that I need a guide,like what parts should I use for this? I want to create a blue banner at the bottom with some text on it using a commands variable,and I want this to show up for everyone. Basicly on such as a command /admintext [text] it will put a bigass blue banner on the bottom showing the text,so what should I look at to get help on this. Btw,If you guys need more information on what I'm just trying to say,just say it,don't get all salty I'm just a [I]newb.[/I] [B][U]PLEASE DO NOT SAY GOTO THE WIKI!!! I JUST WANT A LITTLE HELP FROM YOU GUYS.[/U][/B]
[code]hook.Add( "PlayerSay", "AdminText", function( ply, text ) local command = string.Explode( " ", text ) if ( ply:IsAdmin() and ( command[ 1 ] == "/admintext" or command[ 1 ] == "!admintext" ) ) then BroadcastLua( [[ surface.SetDrawColor( 0, 244, 244 ) surface.DrawRect( 0, ScrH(), ScrW(), ScrH()/10 ) surface.SetTextPos( 0, ScrH() + 100 ) -- very rough estimate, going to look pretty bad surface.DrawText( text ) ]] ) end end )[/code]
[QUOTE=code_gs;47882212][code]hook.Add( "PlayerSay", "AdminText", function( ply, text ) local command = string.Explode( " ", text ) if ( ply:IsAdmin() and ( command[ 1 ] == "/admintext" or command[ 1 ] == "!admintext" ) ) then BroadcastLua( [[ surface.SetDrawColor( 0, 244, 244 ) surface.DrawRect( 0, ScrH(), ScrW(), ScrH()/10 ) surface.SetTextPos( 0, ScrH() + 100 ) -- very rough estimate, going to look pretty bad surface.DrawText( text ) ]] ) end end )[/code][/QUOTE] Thanks so much man! Very helpful,I'll play around with this,and this would go on the lua/autorun of the servers files I presume?
[sp2]Nice frame[/sp2] [highlight](User was banned for this post ("why reply/tag abuse" - Robotboy655))[/highlight]
Sorry, you need to Log In to post a reply to this thread.