Jump to content

تعديل


Recommended Posts

Posted

الكود هذا فتح بوابة بكلمة

كلما سويت ترايقر للكينت عشان يطلع صوت اذا فتحت البوابة او قفلت

يجي اخطاء اتمنى التصحيح

  
function createTheGata () 
         myGate2 = createObject ( 980, 489.5, -2499.1000976563, 3.0999999046326, 0, 0, 90 ) 
      end 
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGata ) 
 function openMyGata ( ) 
 moveObject ( myGate2, 1500, 489.5, -2499.1000976563, -3.0999999046326, 0, 0, 0 ) 
exports['topbarchat']:sendClientMessage ( "تم فتح البوابة ", root, 255, 255, 255, true ) 
  triggerClientEvent("ee",getLocalPlayer())   
 end 
 addCommandHandler("O",openMyGata) 
  
 function movingMyGataBack () 
 moveObject ( myGate2, 1500, 489.5, -2499.1000976563, 3.0999999046326, 0, 0, 0 ) 
exports['topbarchat']:sendClientMessage ( "تم إغلاق البوابة ", root, 255, 255, 255, true ) 
    triggerClientEvent("ee",getLocalPlayer())   
 end 
 addCommandHandler("C",movingMyGataBack) 
  

client

  
  
addEvent ( "ee", true ) 
  
addEventHandler ( "ee", root, 
  
    function ( ) 
   aa = playSound("abu1.mp3",false) 
        end 
    end 
) 
  

Posted (edited)

تم تعديل الكود وشغال 100% ء ,#

  
  
  
addEvent ( "ee", true ) 
addEventHandler ( "ee", root, 
    function ( ) 
    sound = playSound("abu1.mp3",false) 
    end 
) 
  
addEvent ( "gg", true ) 
addEventHandler ( "gg", root, 
    function ( ) 
    stopSound( sound ) 
    end 
) 
  
  

EDITED#

SEVER SIDE ---

  
  
function createTheGata () 
         myGate2 = createObject ( 980, 489.5, -2499.1000976563, 3.0999999046326, 0, 0, 90 ) 
      end 
      addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGata ) 
 function openMyGata ( playerSource ) 
 moveObject ( myGate2, 1500, 489.5, -2499.1000976563, -3.0999999046326, 0, 0, 0 ) 
exports['topbarchat']:sendClientMessage ( "تم فتح البوابة ", root, 255, 255, 255, true ) 
    triggerClientEvent("ee",playerSource)   
 end 
 addCommandHandler("O",openMyGata) 
 function movingMyGataBack ( playerSource ) 
 moveObject ( myGate2, 1500, 489.5, -2499.1000976563, 3.0999999046326, 0, 0, 0 ) 
exports['topbarchat']:sendClientMessage ( "تم إغلاق البوابة ", root, 255, 255, 255, true ) 
    triggerClientEvent("gg",playerSource)    
 end 
 addCommandHandler("C",movingMyGataBack) 
  

Edited by Guest
Posted
myGate2 = createObject(980, 489.5, -2499.1, 3.1, 0, 0, 90) 
  
function openMyGata(player) 
    moveObject(myGate2, 1500, 489.5, -2499.1, -3.1) 
    exports['topbarchat']:sendClientMessage("تم فتح البوابة ", player, 255, 255, 255, true) 
    triggerClientEvent(player, "ee", player) 
end 
addCommandHandler("O", openMyGata) 
  
function movingMyGataBack() 
    moveObject(myGate2, 1500, 489.5, -2499.1, 3.1, 0, 0, 0 ) 
    exports['topbarchat']:sendClientMessage("تم إغلاق البوابة ", player, 255, 255, 255, true) 
    triggerClientEvent(player, "ee", player)   
end 
addCommandHandler("C", movingMyGataBack) 

addEvent("ee", true) 
addEventHandler("ee", root, 
function() 
    playSound("abu1.mp3") 
end) 

Posted

جنرال كودك مدري اش الخطا اللي فيه

لكن تابل البوابة اذا فتحتها يشتغل الصوت ويطلع الكلام

لكن اذا قفلتها مايطلع الكلام ولا الصوت

تابل كاتبة كذا فما اشتغل

function movingMyGataBack()

انا اضفت ارقمنت

function movingMyGataBack(player)

والف الف شكر ياتابل وجنرال منكم نتعلم

Posted
وش بلاك قبل شوي تسوي الموضوع وتوخره @_@

المهم سويته لك

ججرب كلنت :

[lua] 

 

 

addEvent ( "ee", true )

addEventHandler ( "ee", root,

    function ( )

    playSound("abu1.mp3",false)

        end

    end

)

 

عندك اند زيآده

Posted

وش الخطأ الي عندي واحد اند زائد تقدر توخره :$

+ اذا تبي تتعلم لازم تكتشف الاخطاء لأني انا الي حاط الاند الزائد متعمد

^ لا جد متعمد :]

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