Jump to content

تعديل


Dr.Xen

Recommended Posts

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

ابي تعديل اذا ضغط مايروح على طول .. ينتظر لين يموت لومات يروح

توضيح : مثلا لو ضغطت الثانية ما انتقل عل طول لو متت انتقل

  
     
  
     
        addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
         if ( source == GUIEditor.button[1] ) then 
                local element = getPedOccupiedVehicle ( getLocalPlayer (   ) ) or getLocalPlayer (   ) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[2] ) then 
                local element = getPedOccupiedVehicle ( getLocalPlayer (   ) ) or getLocalPlayer (   ) 
                setElementPosition(element,297.23212,191.4963,1007.17188) 
                                setElementInterior ( element, 3 ) 
                    setElementDimension ( element, 0  ) 
                setPedRotation(element, 91.98) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[3]) then 
                local element = getPedOccupiedVehicle ( getLocalPlayer (   ) ) or getLocalPlayer (   ) 
                setElementPosition(element,-1615.38806,684.90344,7.18750) 
                setPedRotation(element, 91.98) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false) 
  
        end 
    end )    

Link to comment

جرب

  
    
  
    
        addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
         if ( source == GUIEditor.button[1] ) then 
                local element = getPedOccupiedVehicle ( getLocalPlayer (   ) ) or getLocalPlayer (   ) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[2] ) then 
    outputChatBox("سيتم نقلك بعد آن تموت", 0,255,0,true) 
        setElementData(getLocalPlayer (), "spawn", true) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[3]) then 
                local element = getPedOccupiedVehicle ( getLocalPlayer (   ) ) or getLocalPlayer (   ) 
                setElementPosition(element,-1615.38806,684.90344,7.18750) 
                setPedRotation(element, 91.98) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false) 
  
        end 
    end )   
  
function wastedspawn (  ) 
    if getElementData(source, "spawn") then 
                    setElementPosition(source,297.23212,191.4963,1007.17188) 
                    setElementInterior (source, 3 ) 
                    setElementDimension (source, 0  ) 
                    setPedRotation(source, 91.98) 
        setElementData(source, "spawn", false) 
    end 
end 
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wastedspawn) 

Link to comment

جرب

  
        addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
         if ( source == GUIEditor.button[1] ) then 
                local element = getPedOccupiedVehicle ( getLocalPlayer (   ) ) or getLocalPlayer (   ) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[2] ) then 
    outputChatBox("سيتم نقلك بعد آن تموت", 0,255,0,true) 
        setElementData(getLocalPlayer (), "spawn", true) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[3]) then 
                local element = getPedOccupiedVehicle ( getLocalPlayer (   ) ) or getLocalPlayer (   ) 
                setElementPosition(element,-1615.38806,684.90344,7.18750) 
                setPedRotation(element, 91.98) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false) 
  
        end 
    end )   
  
function wastedspawn (  ) 
    if getElementData(source, "spawn") == "true" then 
                    setElementPosition(source,297.23212,191.4963,1007.17188) 
                    setElementInterior (source, 3 ) 
                    setElementDimension (source, 0  ) 
                    setPedRotation(source, 91.98) 
        setElementData(source, "spawn", false) 
    end 
end 
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wastedspawn) 

Link to comment

الطريقه سهله تقدر تسويها دام سويت الكود الي فوق ...

يوم يضغط الزر سوي للاعب داتا ...

setElementData ( localPlayer, 'Tele', true ) 

onClientPlayerWasted واستخدم حدث

وتحقق اذا عنده داتا او لا ,

if getElementData ( source, 'Tele' ) then 

setElementPosition وبعدين انقل اللاعب بإستخدام

removeElementData واذا تبي تحذف الداتا سوي تريقر للسيرفر واستخدم الوظيفه

Link to comment

الطريقه سهله تقدر تسويها دام سويت الكود الي فوق ...

يوم يضغط الزر سوي للاعب داتا ...

setElementData ( localPlayer, 'Tele', true ) 

onClientPlayerWasted واستخدم حدث

وتحقق اذا عنده داتا او لا ,

if getElementData ( source, 'Tele' ) then 

setElementPosition وبعدين انقل اللاعب بإستخدام

removeElementData واذا تبي تحذف الداتا سوي تريقر للسيرفر واستخدم الوظيفه

لآ لآ آللي مخرب عليه آلشغل

setElementPosition وبعدين انقل اللاعب بإستخدام

لآنه ميت

عنددهـ طريقتين آمآ يسوي

تريقر من كلنت آلى سيرفر ويحط بآلسيرفر

spawnPlayer 

آو تغير آلحدث وتخليه

onClientPlayerSpawn

وآلثآنية آسهل

Link to comment

كلامك لخبطني بس آضن تبيه كذا

Client side

  
addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
    if ( source == GUIEditor.button[1] ) then 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false)           
    elseif ( source == GUIEditor.button[2] ) then 
        setElementData( localPlayer, "teleport1", true) 
    elseif ( source == GUIEditor.button[3]) then 
        setElementData( localPlayer, "teleport2", true) 
     
         
    end 
end 
) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
if getElementData(localPlayer, "teleport1", true) then 
triggerServerEvent("spawnplayer1", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  
setElementData ( localPlayer, "teleport1", false) 
elseif getElementData(localPlayer, "teleport2", true) 
triggerServerEvent("spawnplayer2", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
setElementData ( localPlayer, "teleport2", false) 
else return 
end 
end 
) 
  

Server side

  
addEvent("spawnplayer1", true) 
addEventHandler("spawnplayer1", root, 
function () 
spawnPlayer(source, 297.23212,191.4963,1007.17188) 
setElementRotation(source, 0,0,91.98) 
setElementInterior ( source, 3 ) 
setElementDimension ( source, 0  ) 
end 
) 
  
addEvent("spawnplayer2", true) 
addEventHandler("spawnplayer2", root, 
function () 
spawnPlayer(source, -1615.38806,684.90344,7.18750) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  

ماجربت السكربت ^

Edited by Guest
Link to comment
كلامك لخبطني بس آضن تبيه كذا

Client side

  
addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
    if ( source == GUIEditor.button[1] ) then 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false)           
    elseif ( source == GUIEditor.button[2] ) then 
        setElementData( localPlayer, "teleport1", true) 
    elseif ( source == GUIEditor.button[3]) then 
        setElementData( localPlayer, "teleport2", true) 
     
         
    end 
end 
) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
local element = getPedOccupiedVehicle ( getLocalPlayer () ) 
if getElementData ( localPlayer, "teleport1", true) then 
triggerServerEvent(source, "spawnplayer1") 
setElementInterior ( element, 3 ) 
setElementDimension ( element, 0  ) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  
setElementData ( localPlayer, "teleport1", false) 
elseif getElementData ( localPlayer, "teleport2", true) then 
triggerServerEvent(source, "spawnplayer2") 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
setElementData ( localPlayer, "teleport2", false) 
end 
end 
) 
  

Server side

  
addEvent("spawnplayer1", true) 
addEventHandler("spawnplayer1", root, 
function 
spawnPlayer(source, 297.23212,191.4963,1007.17188) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  
addEvent("spawnplayer2", true) 
addEventHandler("spawnplayer2", root, 
function () 
spawnPlayer(source, -1615.38806,684.90344,7.18750) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  

ماجربت السكربت ^

آغلآط كثير

منهآ

if getElementData ( localPlayer, "teleport1", true) then 
  

آلمفروض يكون كذآ

if getElementData ( localPlayer, "teleport1") then 
  

لآنك آنت تجيب آلدآتا

var getElementData ( element theElement, string key [, inherit = true] ) 

وليس تحطهآ

setElementInterior ( element, 3 ) 
setElementDimension ( element, 0  ) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  

من وين جبت آلمنت حط سورس + ليه تزيل آللوحة آصلآ هي مخفية + آلمفروض تحط آلديم وآلآنت في آلسيرفر مع آلسبآون

:D بآلتوفيق

Link to comment

كودكـ يسير كذآ

  
        addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
         if ( source == GUIEditor.button[1] ) then 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[2] ) then 
        outputChatBox("سيتم نقلك بعد آن تموت", 0,255,0,true) 
        setElementData(getLocalPlayer (), "spawnA", true) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[3]) then 
        outputChatBox("سيتم نقلك بعد آن تموت", 0,255,0,true) 
        setElementData(getLocalPlayer (), "spawnB", true) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false) 
  
        end 
    end )   
  
function spawn (  ) 
    if getElementData(source, "spawnA") then 
                    setElementPosition(source,297.23212,191.4963,1007.17188) 
                    setElementInterior (source, 3 ) 
                    setElementDimension (source, 0  ) 
                    setPedRotation(source, 91.98) 
        setElementData(source, "spawnA", false) 
    elseif getElementData(source, "spawnB") then 
                setElementPosition(source, -1615.38806,684.90344,7.18750) 
                setPedRotation(source, 91.98) 
        setElementData(source, "spawnB", false) 
    end 
end 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), spawn) 

Link to comment
كلامك لخبطني بس آضن تبيه كذا

Client side

  
addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
    if ( source == GUIEditor.button[1] ) then 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false)           
    elseif ( source == GUIEditor.button[2] ) then 
        setElementData( localPlayer, "teleport1", true) 
    elseif ( source == GUIEditor.button[3]) then 
        setElementData( localPlayer, "teleport2", true) 
     
         
    end 
end 
) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
local element = getPedOccupiedVehicle ( getLocalPlayer () ) 
if getElementData ( localPlayer, "teleport1", true) then 
triggerServerEvent(source, "spawnplayer1") 
setElementInterior ( element, 3 ) 
setElementDimension ( element, 0  ) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  
setElementData ( localPlayer, "teleport1", false) 
elseif getElementData ( localPlayer, "teleport2", true) then 
triggerServerEvent(source, "spawnplayer2") 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
setElementData ( localPlayer, "teleport2", false) 
end 
end 
) 
  

Server side

  
addEvent("spawnplayer1", true) 
addEventHandler("spawnplayer1", root, 
function 
spawnPlayer(source, 297.23212,191.4963,1007.17188) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  
addEvent("spawnplayer2", true) 
addEventHandler("spawnplayer2", root, 
function () 
spawnPlayer(source, -1615.38806,684.90344,7.18750) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  

ماجربت السكربت ^

آغلآط كثير

منهآ

if getElementData ( localPlayer, "teleport1", true) then 
  

آلمفروض يكون كذآ

if getElementData ( localPlayer, "teleport1") then 
  

لآنك آنت تجيب آلدآتا

var getElementData ( element theElement, string key [, inherit = true] ) 

وليس تحطهآ

setElementInterior ( element, 3 ) 
setElementDimension ( element, 0  ) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  

من وين جبت آلمنت حط سورس + ليه تزيل آللوحة آصلآ هي مخفية + آلمفروض تحط آلديم وآلآنت في آلسيرفر مع آلسبآون

:D بآلتوفيق

رد زاحف يكفي , والثانيه كنت معرفها بس عدلتها عقب وخليتها كلها بالسيرفر سايد وانت مقتبس ردي قبل ما اعدلها

@ KING_HOHO : انت ما قريت السنتكس قبل لا تكلم الرجال -_-
var getElementData ( element theElement, string key [, inherit = true] ) 

:oops:

وبالنسبة للالمنت فـ معرفه هو .

:oops:

لآكن كيف يكون معه سيآرهـ وهو ميت

شيك ع الكود اللي مسويه راعي الموضوع

عموماً آنا شلته وسويت اللي فوق ^

Link to comment
القصد من كلامي انه هو معرف المنت

آنآ كنت آقصد كلمة آلمنت مو الآلمنت

local element = getPedOccupiedVehicle ( getLocalPlayer () ) 

:) مآشفت آللوكآل آلمنت زين

فحسبته حط بدل آلسورس آلآلمنت آللي مسويله لوكآل

setElementInterior ( element, 3 ) 
setElementDimension ( element, 0  ) 

Link to comment

#بعد آلتحديث

كلامك لخبطني بس آضن تبيه كذا

Client side

  
addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
    if ( source == GUIEditor.button[1] ) then 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false)           
    elseif ( source == GUIEditor.button[2] ) then 
        setElementData( localPlayer, "teleport1", true) 
    elseif ( source == GUIEditor.button[3]) then 
        setElementData( localPlayer, "teleport2", true) 
     
         
    end 
end 
) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
if getElementData(localPlayer, "teleport1", true) then 
triggerServerEvent("spawnplayer1", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  
setElementData ( localPlayer, "teleport1", false) 
elseif getElementData(localPlayer, "teleport2", true) 
triggerServerEvent("spawnplayer2", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
setElementData ( localPlayer, "teleport2", false) 
else return 
end 
end 
) 
  

Server side

  
addEvent("spawnplayer1", true) 
addEventHandler("spawnplayer1", root, 
function () 
spawnPlayer(source, 297.23212,191.4963,1007.17188) 
setElementRotation(source, 0,0,91.98) 
setElementInterior ( source, 3 ) 
setElementDimension ( source, 0  ) 
end 
) 
  
addEvent("spawnplayer2", true) 
addEventHandler("spawnplayer2", root, 
function () 
spawnPlayer(source, -1615.38806,684.90344,7.18750) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  

ماجربت السكربت ^

then نآقص

elseif getElementData(localPlayer, "teleport2", true) 

Link to comment
كودكـ يسير كذآ
  
        addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
         if ( source == GUIEditor.button[1] ) then 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[2] ) then 
        outputChatBox("سيتم نقلك بعد آن تموت", 0,255,0,true) 
        setElementData(getLocalPlayer (), "spawnA", true) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false)           
            elseif ( source == GUIEditor.button[3]) then 
        outputChatBox("سيتم نقلك بعد آن تموت", 0,255,0,true) 
        setElementData(getLocalPlayer (), "spawnB", true) 
                guiSetVisible(GUIEditor.window[1], false) 
                showCursor(false) 
  
        end 
    end )   
  
function spawn (  ) 
    if getElementData(source, "spawnA") then 
                    setElementPosition(source,297.23212,191.4963,1007.17188) 
                    setElementInterior (source, 3 ) 
                    setElementDimension (source, 0  ) 
                    setPedRotation(source, 91.98) 
        setElementData(source, "spawnA", false) 
    elseif getElementData(source, "spawnB") then 
                setElementPosition(source, -1615.38806,684.90344,7.18750) 
                setPedRotation(source, 91.98) 
        setElementData(source, "spawnB", false) 
    end 
end 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), spawn) 

جربت ما زبط!

Link to comment
#بعد آلتحديث
كلامك لخبطني بس آضن تبيه كذا

Client side

  
addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
    if ( source == GUIEditor.button[1] ) then 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false)           
    elseif ( source == GUIEditor.button[2] ) then 
        setElementData( localPlayer, "teleport1", true) 
    elseif ( source == GUIEditor.button[3]) then 
        setElementData( localPlayer, "teleport2", true) 
     
         
    end 
end 
) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
if getElementData(localPlayer, "teleport1", true) then 
triggerServerEvent("spawnplayer1", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  
setElementData ( localPlayer, "teleport1", false) 
elseif getElementData(localPlayer, "teleport2", true) 
triggerServerEvent("spawnplayer2", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
setElementData ( localPlayer, "teleport2", false) 
else return 
end 
end 
) 
  

Server side

  
addEvent("spawnplayer1", true) 
addEventHandler("spawnplayer1", root, 
function () 
spawnPlayer(source, 297.23212,191.4963,1007.17188) 
setElementRotation(source, 0,0,91.98) 
setElementInterior ( source, 3 ) 
setElementDimension ( source, 0  ) 
end 
) 
  
addEvent("spawnplayer2", true) 
addEventHandler("spawnplayer2", root, 
function () 
spawnPlayer(source, -1615.38806,684.90344,7.18750) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  

ماجربت السكربت ^

then نآقص

elseif getElementData(localPlayer, "teleport2", true) 

يعطيك العافيه ما انتبهت لها

ياراعي الموضوع جرب هذا لو بفلوس

Client side

  
addEventHandler ( "onClientGUIClick", guiRoot, function (   ) 
    if ( source == GUIEditor.button[1] ) then 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false)           
    elseif ( source == GUIEditor.button[2] ) then 
        setElementData( localPlayer, "teleport1", true) 
    elseif ( source == GUIEditor.button[3]) then 
        setElementData( localPlayer, "teleport2", true) 
     
         
    end 
end 
) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
if getElementData(localPlayer, "teleport1", true) then 
triggerServerEvent("spawnplayer1", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false)  
setElementData ( localPlayer, "teleport1", false) 
elseif getElementData(localPlayer, "teleport2", true) then 
triggerServerEvent("spawnplayer2", localPlayer) 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
setElementData ( localPlayer, "teleport2", false) 
else return 
end 
end 
) 
  

Server side

  
addEvent("spawnplayer1", true) 
addEventHandler("spawnplayer1", root, 
function () 
spawnPlayer(source, 297.23212,191.4963,1007.17188) 
setElementRotation(source, 0,0,91.98) 
setElementInterior ( source, 3 ) 
setElementDimension ( source, 0  ) 
end 
) 
  
addEvent("spawnplayer2", true) 
addEventHandler("spawnplayer2", root, 
function () 
spawnPlayer(source, -1615.38806,684.90344,7.18750) 
setElementRotation(source, 0,0,91.98) 
end 
) 
  

Link to comment
طيب ممكن تخلي اول ما يموت بعد ثلاث ثوان ينتقل

جرب

  
-- Client-Side 
addEventHandler ( "onClientGUIClick", guiRoot,  
function (   ) 
    if ( source == GUIEditor.button[1] ) then 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false)           
    elseif ( source == GUIEditor.button[2] ) then 
        setElementData( localPlayer, "teleport1", true) 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false) 
    elseif ( source == GUIEditor.button[3]) then 
        setElementData( localPlayer, "teleport2", true) 
        guiSetVisible(GUIEditor.window[1], false) 
        showCursor(false) 
    end 
end 
) 
  
addEventHandler("onClientPlayerWasted", localPlayer, 
function () 
  if getElementData(localPlayer, "teleport1", true) then 
    triggerServerEvent("spawnplayer1", localPlayer) 
    setElementData ( localPlayer, "teleport1", false) 
  elseif getElementData(localPlayer, "teleport2", true) then 
    triggerServerEvent("spawnplayer2", localPlayer) 
    setElementData ( localPlayer, "teleport2", false) 
  end 
end 
) 
  

  
-- Server-Side 
addEvent("spawnplayer1", true) 
addEventHandler("spawnplayer1", root, 
function () 
setTimer(function () spawnPlayer(source, 297.23212,191.4963,1007.17188) 
setElementRotation(source, 0,0,91.98) 
setElementInterior ( source, 3 ) 
setElementDimension ( source, 0  ) 
end, 3000, 1) 
end 
) 
  
addEvent("spawnplayer2", true) 
addEventHandler("spawnplayer2", root, 
function () 
setTimer(function () spawnPlayer(source, -1615.38806,684.90344,7.18750) 
setElementRotation(source, 0,0,91.98) 
end, 3000, 1) 
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...