Guest Posted July 22, 2018 Share Posted July 22, 2018 شباب سويت المود هذا عشان اكتب في شاشة كل اللاعبين ايش الأخطاء؟ serverside: function shout ( player, cmd, ... ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local message = table.concat ( { ... }," " ) for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do end outputChatBox("#ff0000(#FF0040Shoutall#ff0000)"..getPlayerName(player)..": #ffffff"..message.."", root, 255, 255, 255, true) else outputChatBox ( "You cannot use this command!", player, 255, 12, 15 ) end end addCommandHandler ( "shoutall", shout ) clientside: function shout ( player, cmd, ... ) local message = table.concat ( { ... }," " ) local name = getPlayerName(thePlayer) textDisplayAddObserver ( textDisplay, thePlayer ) dxDrawText(getPlayerName(player)..", message", 204, 36, 816, 557, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "top", false, true, false, false, false) setTimer ( function ( ) textDestroyTextItem ( textItem ) textDestroyDisplay ( textDisplay ) end ,10000, 1 ) end Link to comment
Trefeor Posted July 22, 2018 Share Posted July 22, 2018 انت خالط اكواد سيرفر مع كلنت لو حاب تسويها ب dxDrawText إستخدم الترايقر triggerClientEvent Link to comment
Guest Posted July 23, 2018 Share Posted July 23, 2018 (edited) اه بعرفه هذا قالولي عليه بس مش عارف استخدمه و ايش يعني هذاك الكود و وين اضعه؟ textDestroyTextItem ( textItem ) textDestroyDisplay ( textDisplay ) textDisplayAddObserver ( textDisplay, thePlayer ) اكواد ذي حطيتها في سيرفر سايد بس مو شغال صار هيك function shout ( player, cmd, ... ) local message = table.concat ( { ... }," " ) local name = getPlayerName(thePlayer) dxDrawText(""..name.." "..message..", 204, 36, 816, 557, tocolor(255, 255, 255, 255), 2.00, "bankgothic", "center", "top", false, true, false, false, false) end سيرفرسايد function shout ( player, cmd, ... ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local message = table.concat ( { ... }," " ) for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do end outputChatBox("#ff0000(#FF0040Shoutall#ff0000)"..getPlayerName(player)..": #ffffff"..message.."", root, 255, 255, 255, true) else outputChatBox ( "You cannot use this command!", player, 255, 12, 15 ) end end addCommandHandler ( "shoutall", shout ) Edited July 23, 2018 by Guest Link to comment
#Major . Posted July 23, 2018 Share Posted July 23, 2018 (edited) 56 minutes ago, Scarfas said: dxDrawText Draws a string of text on the screen for one frame. In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see onClientRender). Edited July 23, 2018 by *RayaN-Alharbi. Link to comment
Trefeor Posted July 23, 2018 Share Posted July 23, 2018 (edited) جرب هذا --- # Client local Text = "" local sX,sY = guiGetScreenSize ( ) function renderText ( ) dxDrawText ( Text , 0 , 0 , sX , sY , tocolor(255,255,255,255),1.2,"default-bold","center","center",true, true, false, true, false) end addEvent ( "setDxText" , true ) addEventHandler ( "setDxText" , root , function (te) if ( isTimer ( timer ) ) then killTimer ( timer ) removeEventHandler("onClientRender",root,renderText) end Text = te addEventHandler ( "onClientRender",root,renderText) timer = setTimer ( function ( ) removeEventHandler("onClientRender",root,renderText) Text = "" end,5000,1) end ) ; --- # Server function shout ( player, cmd, ... ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local message = table.concat ( { ... }," " ) triggerClientEvent ( root , "setDxText" , root , message ) else outputChatBox ( "You cannot use this command!", player, 255, 12, 15 ) end end addCommandHandler ( "shoutall", shout ) Edited July 23, 2018 by Trefeor Link to comment
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