Snakegold Posted August 5, 2018 Share Posted August 5, 2018 بدي لما اكتب /shoutall بتطلع رسالة على جميع اللاعبين سويت هذا الكود و ماقدر ازبطه Client: function shout ( player, cmd, ... ) local message = table.concat ( { ... }," " ) local screenW, screenH = guiGetScreenSize() for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( textDisplay, thePlayer ) dxDrawText(""..getPlayerName(player).." \n"..message.."", (screenW - 766) / 2, (screenH - 635) / 2, ((screenW - 766) / 2) + 766, ( (screenH - 635) / 2) + 635, tocolor(255, 0, 0, 255), 2.00, "bankgothic", "center", "top", false, true, false, false, false) triggerClientEvent ( playerSource, "dxDrawText", player ) end setTimer ( function ( ) textDestroyTextItem ( textItem ) textDestroyDisplay ( textDisplay ) end ,10000, 1 ) end addCommandHandler ( "shoutall", shout ) Server: function shout ( player, cmd, ... ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local message = table.concat ( { ... }," " ) outputChatBox("#ff0000(#FF0040Shoutall#ff0000)"..getPlayerName(player)..": #ffffff"..message.."", root, 255, 0, 0, true) else outputChatBox ( "You cannot use this command!", player, 255, 12, 15 ) end end addEvent( "dxDrawText", true ) addCommandHandler ( "shoutall", shout ) Link to comment
#DRAGON!FIRE Posted August 5, 2018 Share Posted August 5, 2018 رساله بالشات يعني ولا ع الشاشه ؟ Link to comment
MR_Mahmoud Posted August 5, 2018 Share Posted August 5, 2018 28 minutes ago, Snakegold said: بدي لما اكتب /shoutall بتطلع رسالة على جميع اللاعبين سويت هذا الكود و ماقدر ازبطه Client: function shout ( player, cmd, ... ) local message = table.concat ( { ... }," " ) local screenW, screenH = guiGetScreenSize() for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( textDisplay, thePlayer ) dxDrawText(""..getPlayerName(player).." \n"..message.."", (screenW - 766) / 2, (screenH - 635) / 2, ((screenW - 766) / 2) + 766, ( (screenH - 635) / 2) + 635, tocolor(255, 0, 0, 255), 2.00, "bankgothic", "center", "top", false, true, false, false, false) triggerClientEvent ( playerSource, "dxDrawText", player ) end setTimer ( function ( ) textDestroyTextItem ( textItem ) textDestroyDisplay ( textDisplay ) end ,10000, 1 ) end addCommandHandler ( "shoutall", shout ) Server: function shout ( player, cmd, ... ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local message = table.concat ( { ... }," " ) outputChatBox("#ff0000(#FF0040Shoutall#ff0000)"..getPlayerName(player)..": #ffffff"..message.."", root, 255, 0, 0, true) else outputChatBox ( "You cannot use this command!", player, 255, 12, 15 ) end end addEvent( "dxDrawText", true ) addCommandHandler ( "shoutall", shout ) استخدم اي مود عاجل منشور وتقدر تكتب في اف 8 ليه تعزب حالك Link to comment
N3xT Posted August 5, 2018 Share Posted August 5, 2018 انت حاط فنكشنات سيرفر سايد بالكلينت سايد 1 Link to comment
Snakegold Posted August 5, 2018 Author Share Posted August 5, 2018 (edited) function shout ( player, cmd, ... ) local message = table.concat ( { ... }," " ) local screenW, screenH = guiGetScreenSize() for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do addEventHandler("onClientRender", root, shout) dxDrawText(""..getPlayerName(player).." "..message.."", (screenW - 766) / 2, (screenH - 635) / 2, ((screenW - 766) / 2) + 766, ( (screenH - 635) / 2) + 635, tocolor(255, 0, 0, 255), 2.00, "bankgothic", "center", "top", false, true, false, false, false) triggerServerEvent ( playerSource, "dxDrawText", player ) end setTimer ( function ( ) removeEventHandler("onClientRender", root, shout) end ,10000, 1 ) end addCommandHandler ( "shoutall", shout ) سويت هيك و ما اشتغل Edited August 5, 2018 by Snakegold Link to comment
Trefeor Posted August 5, 2018 Share Posted August 5, 2018 جرب هذا م جربته ترا ولو كتبت رسالة بتجي بالنص الشاشة عند كل اللاعبين ---- ' Client ' local Text , SecondToRemoveRender = "" , 5 local sX,sY = guiGetScreenSize ( ) function renderText ( ) dxDrawText ( Text , 0 , 0 , sX , sY , tocolor(255,255,255,200),1.5,"default-bold","center","center",false,false,false,true,false) end addEvent ( "addNewText" , true ) addEventHandler ( "addNewText" , root , function ( msg , plr ) if ( isTimer ( TimerRemove ) ) then killTimer ( TimerRemove ) removeEventHandler ( "onClientRender" , root , renderText ) Text = "" end addEventHandler ( "onClientRender" , root , renderText ) Text = ""..getPlayerName(plr).." #ffffff: "..msg.."" TimerRemove = setTimer (function ( ) removeEventHandler ( "onClientRender" , root , renderText ) Text = "" end,SecondToRemoveRender*1000,1) end ) ---- ' Server ' addCommandHandler ( "shoutall" , function ( Player , cmd , ... ) local message = table.concat ( { ... } , " " ) triggerClientEvent ( root , "addNewText" , root , message , Player ) end ) 1 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