Jump to content

مطلوب فنكشنات ..


Recommended Posts

السلام عليكم ورحمة الله وبركاتة

انا مسوي لوحه به أزرار مسوي:

إنتحار ، دم ، درع ، نيترو ، تصليح السيارة ، نفاثة

أبي الفنكشنات حق ذوول لما الشخص يضغط علي الزر يعطيه

+

أبغي لما اللاعب يضغط علي الزر ينتظر 5 دقائق ويقدر يضغط ثاني

وشكراً لكم

Link to comment

KillPed server side function

-- Client side

if ( source == button ) then  
      triggerServerEvent("KillPed",resourceRoot) 
end 

-- Server Side

function YourFunction() 
killPed(client) 
end  
addEvent("KillPed",true) 
addEventHandler("KillPed",resourceRoot,YourFunction) 

Link to comment
+ أخوي مثلاً إسم زر الإنتحار = kill

يصير كذا

if ( source == button ) then

function commitSuicide ( source )

killPed ( sourcePlayer, source )

end

end

#Client

addEventHandler ( "onClientGUIClick", root, function (    ) 
    if ( source == button ) then 
        triggerServerEvent ( "pkill", localPlayer ) 
    end 
end ) 

#Server

addEvent ( "pkill", true ) 
addEventHandler ( "pkill", root, function (    ) 
    killPlayer ( source, source ) 
    outputChatBox ( "#00FF00* تم قتل الاعب", source, 255, 255, 255, true ) 
end ) 

Link to comment

أبغي لما اللاعب يضغط علي الزر ينتظر 5 دقائق ويقدر يضغط ثاني

بخصوص طلبك هذا

لما ياخذ مثلا النيترو تعطيه داتا باسم النيترو

وسو تايمر يشيل الداتا

مثلا زي كذآ

كود برو قيمر

    addEventHandler("onClientGUIClick",resourceRoot, function ( ) 
    if ( source == button ) then 
    setElementHealth(localPlayer,- 100) 
    end 
     end) 
      

بعد التعديل

  
    addEventHandler("onClientGUIClick",resourceRoot, function ( ) 
    if ( source == button ) then 
    if getElementData ( localPlayer, "AntiFlood" ) == Health  then outputChatBox ("عفوا لآتستطيع الشراء مره اخرى إلا بعد 5 دقائق !") return end 
    setElementData ( localPlayer ,"AntiFlood", Health ) 
    setElementHealth(localPlayer, 100) 
    setTimer ( RemoveData, 60000*5, 1 ) 
    end 
     end) 
      
function RemoveData () 
setElementData ( localPlayer, "AntiFlood", false ) 
end 
  

Link to comment

شباب النيترو وتصليح السيارة ماضبط معي

elseif ( source == Nitro ) then 
      setVehicleNitroLevel(source, 0.1) 
      setVehicleNitroCount(source, 2) 
      setVehicleNitroActivated(source, true) 

elseif ( source == Repair) then 
      fixVehicle ( source ) 

وش الأخطاء ؟

Link to comment
setVehicleNitroActivated -- بفعل  و بعطل النيترو 
setVehicleNitroCount -- مثلا لما تستخدم النيترو لمده بسير قليليل في هاد الفكشن تزيده 
setVehicleNitroLevel -- مدري  

طيب الفنكشن اللي عطيتة لي يعطي نيترو ؟

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