Jump to content

طريقة ربط احداثيات بأحداثيات ملف play <===


Recommended Posts

يعني انا سويت مود انقتالات وابغى اربط احداثيات البداية ب ملف بلأي

ممكن انا اشفر المود واغير البداية ما بغى كل مرة اعدله واشفره

# ... . .<

Edited by Guest
Link to comment

برستيج سويت انا ممكن تشوفه

GUIEditor_Window = {}

GUIEditor_Button = {}

GUIEditor_Window[1] = guiCreateWindow(167,108,474,265,"",false)

GUIEditor_Button[1] = guiCreateButton(36,49,104,55,"",false,GUIEditor_Window[1])

addEventHandler("onClientGUIClick", root,

function ()

if source == GUIEditor_Button[1] then

setElementPosition(localPlayer,1,3,5)

end

end)

========PLAY=========

1,3,5 = 111.0000 , 14156.556 , 14556.5555

function spawn(player)

if not isElement(player) then return end

repeat until spawnPlayer ( player, 1+math.random(1,5), 3+math.random(5,9), 5, 180, Skin, 0, 0)

setCameraTarget(player, player)

showChat(player, true)

end

Link to comment
addEventHandler("onResourceStart", resourceRoot, 
    function() 
        resetMapInfo() 
        for i,player in ipairs(getElementsByType("player")) do 
            spawn(player) 
        end 
    end 
) 
  
1,3,5 = 111.0000 , 14156.556 , 14556.5555 
function spawn(player) 
    if not isElement(player) then return end 
    repeat until spawnPlayer ( player, 1+math.random(1,5), 3+math.random(5,9), 5, 180, Skin, 0, 0) 
    setCameraTarget(player, player) 
    showChat(player, true) 
end 
  
addEventHandler("onPlayerJoin", root, 
    function() 
        spawn(source) 
    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function() 
        setTimer(spawn, 1800, 1, source) 
    end 
) 

GUIEditor_Window = {} 
GUIEditor_Button = {} 
  
GUIEditor_Window[1] = guiCreateWindow(167,108,474,265,"",false) 
GUIEditor_Button[1] = guiCreateButton(36,49,104,55,"",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick", root, 
function () 
if source == GUIEditor_Button[1] then 
setElementPosition(localPlayer,1,3,5)  
end 
end)  
  

Link to comment

-- Server Side --

local xp,xy,xz = 111.0000 , 14156.556 , 14556.5555 
addEventHandler("onResourceStart", resourceRoot, 
    function() 
        for i,player in ipairs(getElementsByType("player")) do 
        setElementData ( player , "x" , xp )  
        setElementData ( player , "y" , xy )  
        setElementData ( player , "z" , xz )  
            spawn(player) 
        end 
    end 
) 
  
function spawn(player) 
    if not isElement(player) then return end 
    repeat until spawnPlayer ( player, xp+math.random(1,5), xy+math.random(5,9), xz,180, Skin, 0, 0) 
    setCameraTarget(player, player) 
    showChat(player, true) 
    fadeCamera(player,   true) 
end 
  
addEventHandler("onPlayerJoin", root, 
    function() 
        spawn(source) 
    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function() 
        setTimer(spawn, 1800, 1, source) 
    end 
) 

-- Client Side --

GUIEditor_Window = {} 
GUIEditor_Button = {} 
  
GUIEditor_Window[1] = guiCreateWindow(167,108,474,265,"",false) 
GUIEditor_Button[1] = guiCreateButton(36,49,104,55,"",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick", root, 
function () 
    if source == GUIEditor_Button[1] then 
    local x = getElementData(localPlayer,"x") 
    local y = getElementData(localPlayer,"y") 
    local z = getElementData(localPlayer,"z") 
    setElementPosition(localPlayer,x,y,z) 
    end 
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...