Jump to content

مساعدة


Guest

Recommended Posts

Posted

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

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
Posted

انت خالط اكواد سيرفر مع كلنت 

لو حاب تسويها ب dxDrawText

إستخدم

الترايقر

triggerClientEvent

 

Skype : live:trefeor

 

Posted (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 by Guest
Posted (edited)
56 minutes ago, Scarfas said:

 

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 by *RayaN-Alharbi.

سقطت تفاحة واحدة ففهم الأنسان معنى الجاذبية

سقطت الملايين من الجثث ولم يفهم الأنسان معنى الأنسانية

===========

One apple fell and people understood Gravity

Millions of bodies fell and people did not understand the meaning of humanity

Spoiler

SOCIAL MEDIA / التواصل الإجتماعي

~[ p_8157bqso1.png SnapChat : xry-n .  ]~

~[ p_815kbq0c2.png 0506748951 . ]~

 

Posted (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 by Trefeor

Skype : live:trefeor

 

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...