abu5lf Posted March 4, 2012 Posted March 4, 2012 (edited) Server function wla(thePlayer, commandName,...) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then local veve = {...} local message = table.concat(veve, " ") triggerClientEvent("new", getRootElement(),message) end end addCommandHandler("AM", wla) Clinet function start(message) removeEventHandler ( "onClientRender", getRootElement(), as ) function as() dxDrawText("Admin :",17.0,189.0,61.0,206.0,tocolor(255,0,0,255),1.0,"default-bold","top","left",false,false,false) dxDrawText(message,61.0,189.0,264.0,226.0,tocolor(255,255,255,255),1.0,"default-bold","top","left",false,false,false) end addEventHandler("onClientRender", getRootElement(), as) end addEvent("new", true ) addEventHandler("new", getRootElement(), start) function yana(msgmsg) outputChatBox(msgmsg,getRootElement(),255,0,0,true) end addEvent("yanas", true ) addEventHandler("yanas", getRootElement(), yana) bindKey("u", "down", "chatbox","AM") It does not work Edited December 6, 2012 by Guest
Kenix Posted March 4, 2012 Posted March 4, 2012 Client addEvent( 'new', true ) addEvent( "yanas", true ) local sMessage = '' function fStart( sText ) sMessage = sText end function fDraw( ) if sMessage ~= '' then dxDrawText( "Admin :",17.0,189.0,61.0,206.0,tocolor( 255,0,0,255 ),1.0,"default-bold","top","left",false,false,false ) dxDrawText( sMessage,61.0,189.0,264.0,226.0,tocolor( 255,255,255,255 ),1.0,"default-bold","top","left",false,false,false ) end end function fNa( msgmsg ) outputChatBox( msgmsg,255,0,0,true ) end bindKey( "u", "down", "chatbox","AM" ) addEventHandler( 'new', root, fStart ) addEventHandler( 'onClientRender', root, fDraw ) addEventHandler( "yanas", root, fNa )
Kenix Posted March 4, 2012 Posted March 4, 2012 Show meta.xml Please use /debugscript 3. Read this too please viewtopic.php?f=91&t=40807
abu5lf Posted March 4, 2012 Author Posted March 4, 2012 meta.xml "X" name="AdminMsg" type="script" version="1.0.0" /> This is repeated several times fast [2012-03-04 15:43:07] WARNING: adminmsg\client.lua:12: Bad argument @ 'dxDrawText' [Expected horizontal-align at argument 9, got string 'top'][2012-03-04 15:43:07] WARNING: adminmsg\client.lua:13: Bad argument @ 'dxDrawText' [Expected horizontal-align at argument 9, got string 'top']
Kenix Posted March 4, 2012 Posted March 4, 2012 addEvent( 'new', true ) addEvent( "yanas", true ) local sMessage = '' function fStart( sText ) sMessage = sText end function fDraw( ) if sMessage ~= '' then dxDrawText ( "Admin :", 17.0, 189.0, 61.0, 206.0, tocolor( 255,0,0,255 ), 1.0, "default-bold", "left", "top", false, false, false ) dxDrawText ( sMessage, 61.0, 189.0, 264.0, 226.0, tocolor( 255,225,225,255 ), 1.0, "default-bold", "left", "top", false, false, false ) end end function fNa( msgmsg ) outputChatBox( msgmsg,255,0,0,true ) end bindKey( "u", "down", "chatbox","AM" ) addEventHandler( 'new', root, fStart ) addEventHandler( 'onClientRender', root, fDraw ) addEventHandler( "yanas", root, fNa ) Because you use 9 argument in function dxDrawText 'top', but it argument not exists. alignX: horizontal alignment of the text within the bounding box. Can be "left", "center" or "right".
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now