Jump to content

طلب فنكشنات


Recommended Posts

السلام عليكم

ابي اضيف للتاج حقي ,

تاج الداونلود

يعني اذا كان الاعب لسه يحمل

Downloading يكون every one يصير التاج حقه مو

ممكن مُسـآعدـة وش هي الفنكشنات؟

Link to comment
  • Moderators

* Server

addEventHandler( "onPlayerJoin", root, function(  ) 
     setElementData( source, "download", "Download" ) 
end ) 
  
function chatbox(text, msgtype) 
local account = getAccountName(getPlayerAccount(source)) 
local name = getPlayerName(source) 
 if ( getElementData ( source, "download" ) == "Download" ) then 
        cancelEvent  (   ) 
        outputChatBox("[ Downloading ] " .. name .. ":#ffffff " .. text, root, 255, 255, 255, true) 
   end 
end 
addEventHandler("onPlayerChat", root, chatbox) 

* Client

addEventHandler( "onClientResourceStart", resourceRoot, function(  ) 
  TimerDownload = setTimer( function(   ) 
   if ( isTransferBoxActive (    ) ~= true ) then 
         setElementData( localPlayer, "download", false ) 
         killTimer( TimerDownload ) 
      end 
   end, 10000, 0 ) 
end ) 

Link to comment
  • Other Languages Moderators
* Server
addEventHandler( "onPlayerJoin", root, function(  ) 
     setElementData( source, "download", "Download" ) 
end ) 
  
function chatbox(text, msgtype) 
local account = getAccountName(getPlayerAccount(source)) 
local name = getPlayerName(source) 
 if ( getElementData ( source, "download" ) == "Download" ) then 
        cancelEvent  (   ) 
        outputChatBox("[ Downloading ] " .. name .. ":#ffffff " .. text, root, 255, 255, 255, true) 
   end 
end 
addEventHandler("onPlayerChat", root, chatbox) 

* Client

addEventHandler( "onClientResourceStart", resourceRoot, function(  ) 
  TimerDownload = setTimer( function(   ) 
   if ( isTransferBoxActive (    ) ~= true ) then 
         setElementData( localPlayer, "download", false ) 
         killTimer( TimerDownload ) 
      end 
   end, 10000, 0 ) 
end ) 

ممكن توضح لنا ايش الهدف من سطر 6 في السيرفر سايد؟

Link to comment
  • Moderators
* Server
addEventHandler( "onPlayerJoin", root, function(  ) 
     setElementData( source, "download", "Download" ) 
end ) 
  
function chatbox(text, msgtype) 
local account = getAccountName(getPlayerAccount(source)) 
local name = getPlayerName(source) 
 if ( getElementData ( source, "download" ) == "Download" ) then 
        cancelEvent  (   ) 
        outputChatBox("[ Downloading ] " .. name .. ":#ffffff " .. text, root, 255, 255, 255, true) 
   end 
end 
addEventHandler("onPlayerChat", root, chatbox) 

* Client

addEventHandler( "onClientResourceStart", resourceRoot, function(  ) 
  TimerDownload = setTimer( function(   ) 
   if ( isTransferBoxActive (    ) ~= true ) then 
         setElementData( localPlayer, "download", false ) 
         killTimer( TimerDownload ) 
      end 
   end, 10000, 0 ) 
end ) 

ممكن توضح لنا ايش الهدف من سطر 6 في السيرفر سايد؟

ماله هدف , كنت مستخدمه عندي ونسيت احذفه من الكود :mrgreen:

Link to comment

iBlack.NexT ثاني مرهـ اذكر ع الاقل من سوا الكود :wink:

Client Side

addEventHandler( "onClientResourceStart", resourceRoot, function(  ) 
  TimerDownload = setTimer( function(   ) 
   if ( isTransferBoxActive (    ) ~= true ) then 
         setElementData( localPlayer, "download", false ) 
         killTimer( TimerDownload ) 
      end 
   end, 10000, 0 ) 
end ) 

Server Side

addEventHandler( "onPlayerJoin", root, function(  ) 
     setElementData( source, "download", "Download" ) 
end ) 
Link to comment
  • Moderators
iBlack.NexT ثاني مرهـ اذكر ع الاقل من سوا الكود :wink:
Client Side

addEventHandler( "onClientResourceStart", resourceRoot, function(  ) 
  TimerDownload = setTimer( function(   ) 
   if ( isTransferBoxActive (    ) ~= true ) then 
         setElementData( localPlayer, "download", false ) 
         killTimer( TimerDownload ) 
      end 
   end, 10000, 0 ) 
end ) 

Server Side

addEventHandler( "onPlayerJoin", root, function(  ) 
     setElementData( source, "download", "Download" ) 
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...