Jump to content

مساعدة


Recommended Posts

بدي لما اكتب /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
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
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 by Snakegold
Link to comment

جرب هذا م جربته ترا 

ولو كتبت رسالة بتجي بالنص الشاشة عند كل اللاعبين 

---- ' 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 ) 

 

  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...