Jump to content

طلب فنكشن


Recommended Posts

addCommandHandler 
guiCreateStaticImage 
triggerServerEvent 
triggerClientEvent 
getElementsByType -- Loop 
setElementFrozen 
addCommandHandler ( "v" ,  
function () 
guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", true ) 
triggerServerEvent("hassan", localPlayer ) 
 end 
) 
addEvent ( "hassan" , true ) 
addEventHandler ( "hassan" , root, 
function () 
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
setElementFrozen ( v , true ) 
else 
setElementFrozen ( v , false ) 
triggerClientEvent ( source , "hassan1" , source ) 
   end 
end ) 
  
------------------------ 
addEvent ( "hassan1" , true ) 
addEventHandler ( "hassan1" , root, 
function () 
guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) 
 end 
) 
  
  

Link to comment

-- Server Side 
  
addCommandHandler ( "v" , 
function () 
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
triggerClientEvent(v,"hassan", v ) 
setElementFrozen ( v , true ) 
   else 
 setElementFrozen ( v , false ) 
          end 
   end 
) 

-- Client Side 
  
addEvent ( "hassan" , true ) 
addEventHandler ( "hassan" , root, 
function () 
guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) 
 end 
) 
  
Link to comment
-- Server Side 
  
addCommandHandler ( "v" , 
function () 
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
triggerClientEvent(v,"hassan", v ) 
setElementFrozen ( v , true ) 
   else 
 setElementFrozen ( v , false ) 
          end 
   end 
) 

-- Client Side 
  
addEvent ( "hassan" , true ) 
addEventHandler ( "hassan" , root, 
function () 
guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) 
 end 
) 
  

بس ابي صوره في نصف

Link to comment
-- Server Side 
  
addCommandHandler ( "v" , 
function () 
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
triggerClientEvent(v,"hassan", v ) 
setElementFrozen ( v , true ) 
   else 
 setElementFrozen ( v , false ) 
          end 
   end 
) 

-- Client Side 
  
addEvent ( "hassan" , true ) 
addEventHandler ( "hassan" , root, 
function () 
guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) 
 end 
) 
  

كيف else?

وما فيه if ?

Link to comment

الكود خاطئ

  --server 
used = true 
  
addCommandHandler('command', 
function () 
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
if used then 
setElementFrozen ( v , true ) 
triggerClientEvent("event",v) 
used = false 
else 
triggerClientEvent (v,"event2",v) 
setElementFrozen(v,false) 
used = true 
   end 
  end 
end ) 

  
--client 
local w,h = guiGetScreenSize() 
  
img  = guiCreateStaticImage((w-167) /2 ,(h - 132) /2, 167, 132, "image.png", false) 
guiSetVisible(img,false) 
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
guiSetVisible(img,true) 
end ) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function ( ) 
guiSetVisible(img,false) 
end ) 

Link to comment
الكود خاطئ
  --server 
used = true 
  
addCommandHandler('command', 
function () 
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
if used then 
setElementFrozen ( v , true ) 
triggerClientEvent("event",v) 
used = false 
else 
triggerClientEvent (v,"event2",v) 
setElementFrozen(v,false) 
used = true 
   end 
  end 
end ) 

  
--client 
local w,h = guiGetScreenSize() 
  
img  = guiCreateStaticImage((w-167) /2 ,(h - 132) /2, 167, 132, "image.png", false) 
guiSetVisible(img,false) 
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
guiSetVisible(img,true) 
end ) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function ( ) 
guiSetVisible(img,false) 
end ) 

تمت الافاده بس ابي بس الكونسل

Link to comment

ما ظبط

يقلي الدي بوق

local w,h = guiGetScreenSize() 
  
wait  = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
guiSetVisible(wait,false) 
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
guiSetVisible(wait,true) 
end ) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function ( ) 
guiSetVisible(wait,false) 
end ) 
  

1440417108051.png

Link to comment

server

  
used = true 
  
addCommandHandler('command', 
function ( player ) 
for _,v in ipairs ( getElementsByType ( "player" ) ) do 
if not (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)),aclGetGroup("Console"))) then 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then 
if used then 
setElementFrozen ( v , true ) 
triggerClientEvent("event",v) 
used = false 
else 
triggerClientEvent (v,"event2",v) 
setElementFrozen(v,false) 
used = true 
      end 
else 
outputChatBox("access denied ",player,255,0,0)  
    end 
   end 
  end 
end ) 
  

Link to comment
ما ظبط

يقلي الدي بوق

local w,h = guiGetScreenSize() 
  
wait  = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
guiSetVisible(wait,false) 
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
guiSetVisible(wait,true) 
end ) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function ( ) 
guiSetVisible(wait,false) 
end ) 
  

1440417108051.png

ضع هذا الكود بـ أول الكلينت

function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) 
    local gifElement = createElement ( "dx-gif" ) 
    if ( gifElement ) then 
        setElementData ( 
            gifElement, 
            "gifData", 
            { 
                x = x, 
                y = y, 
                w = w, 
                h = h, 
                imgPath = path, 
                startID = iStart, 
                imgID = iStart, 
                imgType = iType, 
                speed = effectSpeed, 
                tick = getTickCount ( ) 
            }, 
            false 
        ) 
        return gifElement 
    else 
        return false 
    end 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local currentTick = getTickCount ( ) 
        for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do 
            local gifData = getElementData ( gif, "gifData" ) 
            if ( gifData ) then 
                if ( currentTick - gifData.tick >= gifData.speed ) then 
                    gifData.tick = currentTick 
                    gifData.imgID = ( gifData.imgID + 1 ) 
                    if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then 
                        gifData.imgID = gifData.imgID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    else 
                        gifData.imgID = gifData.startID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    end 
                end 
                dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) 
            end 
        end 
    end 
) 

Link to comment
ما ظبط

يقلي الدي بوق

local w,h = guiGetScreenSize() 
  
wait  = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
guiSetVisible(wait,false) 
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
guiSetVisible(wait,true) 
end ) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function ( ) 
guiSetVisible(wait,false) 
end ) 
  

1440417108051.png

ضع هذا الكود بـ أول الكلينت

function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) 
    local gifElement = createElement ( "dx-gif" ) 
    if ( gifElement ) then 
        setElementData ( 
            gifElement, 
            "gifData", 
            { 
                x = x, 
                y = y, 
                w = w, 
                h = h, 
                imgPath = path, 
                startID = iStart, 
                imgID = iStart, 
                imgType = iType, 
                speed = effectSpeed, 
                tick = getTickCount ( ) 
            }, 
            false 
        ) 
        return gifElement 
    else 
        return false 
    end 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local currentTick = getTickCount ( ) 
        for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do 
            local gifData = getElementData ( gif, "gifData" ) 
            if ( gifData ) then 
                if ( currentTick - gifData.tick >= gifData.speed ) then 
                    gifData.tick = currentTick 
                    gifData.imgID = ( gifData.imgID + 1 ) 
                    if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then 
                        gifData.imgID = gifData.imgID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    else 
                        gifData.imgID = gifData.startID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    end 
                end 
                dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) 
            end 
        end 
    end 
) 

1440417427631.png

function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) 
    local gifElement = createElement ( "dx-gif" ) 
    if ( gifElement ) then 
        setElementData ( 
            gifElement, 
            "gifData", 
            { 
                x = x, 
                y = y, 
                w = w, 
                h = h, 
                imgPath = path, 
                startID = iStart, 
                imgID = iStart, 
                imgType = iType, 
                speed = effectSpeed, 
                tick = getTickCount ( ) 
            }, 
            false 
        ) 
        return gifElement 
    else 
        return false 
    end 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local currentTick = getTickCount ( ) 
        for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do 
            local gifData = getElementData ( gif, "gifData" ) 
            if ( gifData ) then 
                if ( currentTick - gifData.tick >= gifData.speed ) then 
                    gifData.tick = currentTick 
                    gifData.imgID = ( gifData.imgID + 1 ) 
                    if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then 
                        gifData.imgID = gifData.imgID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    else 
                        gifData.imgID = gifData.startID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    end 
                end 
                dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) 
            end 
        end 
    end 
) 
  
local w,h = guiGetScreenSize() 
  
wait  = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
guiSetVisible(wait,false) 
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
guiSetVisible(wait,true) 
end ) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function ( ) 
guiSetVisible(wait,false) 
end ) 
  
  
  
  
  
  

Link to comment
function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) 
    local gifElement = createElement ( "dx-gif" ) 
    if ( gifElement ) then 
        setElementData ( 
            gifElement, 
            "gifData", 
            { 
                x = x, 
                y = y, 
                w = w, 
                h = h, 
                imgPath = path, 
                startID = iStart, 
                imgID = iStart, 
                imgType = iType, 
                speed = effectSpeed, 
                tick = getTickCount ( ) 
            }, 
            false 
        ) 
        return gifElement 
    else 
        return false 
    end 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local currentTick = getTickCount ( ) 
        for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do 
            local gifData = getElementData ( gif, "gifData" ) 
            if ( gifData ) then 
                if ( currentTick - gifData.tick >= gifData.speed ) then 
                    gifData.tick = currentTick 
                    gifData.imgID = ( gifData.imgID + 1 ) 
                    if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then 
                        gifData.imgID = gifData.imgID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    else 
                        gifData.imgID = gifData.startID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    end 
                end 
                dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) 
            end 
        end 
    end 
) 
  
local w,h = guiGetScreenSize() 
  
Dx  = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
removeEventHandler("onClientRender",root,Dx) 
  
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
addEventHandler("onClientRender",root,Dx)  
 end  
) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function  ( ) 
  if removeEventHandler("onClientRender",root,Dx) then   
   removeEventHandler("onClientRender",root,Dx) 
  end 
end ) 

رجعت المشكله ذي

1440417427631.png

Link to comment

function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) 
    local gifElement = createElement ( "dx-gif" ) 
    if ( gifElement ) then 
        setElementData ( 
            gifElement, 
            "gifData", 
            { 
                x = x, 
                y = y, 
                w = w, 
                h = h, 
                imgPath = path, 
                startID = iStart, 
                imgID = iStart, 
                imgType = iType, 
                speed = effectSpeed, 
                tick = getTickCount ( ) 
            }, 
            false 
        ) 
        return gifElement 
    else 
        return false 
    end 
end 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local currentTick = getTickCount ( ) 
        for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do 
            local gifData = getElementData ( gif, "gifData" ) 
            if ( gifData ) then 
                if ( currentTick - gifData.tick >= gifData.speed ) then 
                    gifData.tick = currentTick 
                    gifData.imgID = ( gifData.imgID + 1 ) 
                    if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then 
                        gifData.imgID = gifData.imgID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    else 
                        gifData.imgID = gifData.startID 
                        setElementData ( gif, "gifData", gifData, false ) 
                    end 
                end 
                dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) 
            end 
        end 
    end 
) 
  
function Dx () 
dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
  end 
  
  
addEvent("event",true) 
addEventHandler("event",root, 
function ( ) 
addEventHandler("onClientRender",root,Dx) 
 end 
) 
  
addEvent("event2",true) 
addEventHandler("event2",root, 
function  ( ) 
   removeEventHandler("onClientRender",root,Dx) 
end  
) 
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...