Jump to content

مساعدة


Guest

Recommended Posts

شباب سويت المود هذا عشان اكتب في شاشة كل اللاعبين ايش الأخطاء؟

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

اه بعرفه هذا قالولي عليه بس مش عارف استخدمه و ايش يعني هذاك الكود و وين اضعه؟

                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 by Guest
Link to comment

جرب هذا

--- # 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 by Trefeor
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...