Beiträge von Homie3

    ich habe mir diese freeroam ressource einfach rutergeladen und auf meinem server gestartet muss ich denn noch etwas dazu machen? wenn ja dann erklärt mir was oder mach einfach einen link zu der erklärung.....
    wie gesagt ich bin ein anfänger aber die grundlagen des scriptens hab ich schon gelernt^^

    wenn du coords meinst ich hab danach gesucht aber nichts gefunden ich meine emein problem ist ja wenn ich ins spiel gehe (also in MEINEn server) hab ich nur blauen himmel ! weil ich bei dem mod nichts mit coords gefunden hab dachte ich mir ich müsste noch eine pawn datei oder so erstellen um überhaut eine landschaft zu sehen denn ich seh wie gesagt nur blauen himmel!

    ---------------------------
    -- Set position window
    ---------------------------
    do
    local screenWidth, screenHeight = guiGetScreenSize()
    if screenHeight < 700 then
    g_MapSide = 450
    else
    g_MapSide = 700
    end
    end


    function setPosInit()
    local x, y, z = getElementPosition(g_Me)
    setControlNumbers(wndSetPos, { x = x, y = y, z = z })


    addEventHandler('onClientRender', g_Root, updatePlayerBlips)
    end


    function fillInPosition(relX, relY)
    local x = relX*6000 - 3000
    local y = 3000 - relY*6000
    local hit, hitX, hitY, hitZ
    hit, hitX, hitY, hitZ = processLineOfSight(x, y, 3000, x, y, -3000)
    setControlNumbers(wndSetPos, { x = x, y = y, z = hitZ or 0 })
    end


    function setPosClick()
    setPlayerPosition(getControlNumbers(wndSetPos, {'x', 'y', 'z'}))
    closeWindow(wndSetPos)
    end


    function setPlayerPosition(x, y, z)
    local elem = getPedOccupiedVehicle(g_Me)
    local distanceToGround
    local isVehicle
    if elem then
    if getPlayerOccupiedSeat(g_Me) ~= 0 then
    errMsg('Only the driver of the vehicle can set its position.')
    return
    end
    distanceToGround = getElementDistanceFromCentreOfMassToBaseOfModel(elem) + 3
    isVehicle = true
    else
    elem = g_Me
    distanceToGround = 0.4
    isVehicle = false
    end
    local hit, hitX, hitY, hitZ = processLineOfSight(x, y, 3000, x, y, -3000)
    if not hit then
    if isVehicle then
    server.fadeVehiclePassengersCamera(false)
    else
    fadeCamera(false)
    end
    setTimer(setCameraMatrix, 1000, 1, x, y, z)
    local grav = getGravity()
    setGravity(0.001)
    g_TeleportTimer = setTimer(
    function()
    local hit, groundX, groundY, groundZ = processLineOfSight(x, y, 3000, x, y, -3000)
    if hit then
    local waterZ = getWaterLevel(x, y, 100)
    z = (waterZ and math.max(groundZ, waterZ) or groundZ) + distanceToGround
    if isPlayerDead(g_Me) then
    server.spawnMe(x, y, z)
    else
    setElementPosition(elem, x, y, z)
    end
    setCameraPlayerMode()
    setGravity(grav)
    if isVehicle then
    server.fadeVehiclePassengersCamera(true)
    else
    fadeCamera(true)
    end
    killTimer(g_TeleportTimer)
    g_TeleportTimer = nil
    end
    end,
    500,
    0
    )
    else
    if isPlayerDead(g_Me) then
    server.spawnMe(x, y, z + distanceToGround)
    else
    setElementPosition(elem, x, y, z + distanceToGround)
    if isVehicle then
    setTimer(setElementVelocity, 100, 1, elem, 0, 0, 0)
    setTimer(setVehicleTurnVelocity, 100, 1, elem, 0, 0, 0)
    end
    end
    end
    end


    function updatePlayerBlips()
    if not g_PlayerData then
    return
    end
    local wnd = isWindowOpen(wndSpawnMap) and wndSpawnMap or wndSetPos
    local mapControl = getControl(wnd, 'map')
    for elem,player in pairs(g_PlayerData) do
    if not player.gui.mapBlip then
    player.gui.mapBlip = guiCreateStaticImage(0, 0, 9, 9, elem == g_Me and 'localplayerblip.png' or 'playerblip.png', false, mapControl)
    player.gui.mapLabelShadow = guiCreateLabel(0, 0, 100, 14, player.name, false, mapControl)
    local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow)
    guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false)
    guiSetFont(player.gui.mapLabelShadow, 'default-bold-small')
    guiLabelSetColor(player.gui.mapLabelShadow, 255, 255, 255)
    player.gui.mapLabel = guiCreateLabel(0, 0, labelWidth, 14, player.name, false, mapControl)
    guiSetFont(player.gui.mapLabel, 'default-bold-small')
    guiLabelSetColor(player.gui.mapLabel, 0, 0, 0)
    for i,name in ipairs({'mapBlip', 'mapLabelShadow'}) do
    addEventHandler('onClientGUIDoubleClick', player.gui[name],
    function()
    server.warpMe(elem)
    closeWindow(wnd)
    end,
    false
    )
    end
    end
    local x, y = getElementPosition(elem)
    x = math.floor((x + 3000) * g_MapSide / 6000) - 4
    y = math.floor((3000 - y) * g_MapSide / 6000) - 4
    guiSetPosition(player.gui.mapBlip, x, y, false)
    guiSetPosition(player.gui.mapLabelShadow, x + 14, y - 4, false)
    guiSetPosition(player.gui.mapLabel, x + 13, y - 5, false)
    end
    end


    addEventHandler('onClientPlayerChangeNick', g_Root,
    function(oldNick, newNick)
    local player = g_PlayerData[source]
    player.name = newNick
    if player.gui.mapLabel then
    guiSetText(player.gui.mapLabelShadow, newNick)
    guiSetText(player.gui.mapLabel, newNick)
    local labelWidth = guiLabelGetTextExtent(player.gui.mapLabelShadow)
    guiSetSize(player.gui.mapLabelShadow, labelWidth, 14, false)
    guiSetSize(player.gui.mapLabel, labelWidth, 14, false)
    end
    end
    )


    function closePositionWindow()
    removeEventHandler('onClientRender', g_Root, updatePlayerBlips)
    end


    wndSetPos = {
    'wnd',
    text = 'Set position',
    width = g_MapSide + 20,
    controls = {
    {'img', id='map', src='map.png', width=g_MapSide, height=g_MapSide, onclick=fillInPosition, ondoubleclick=setPosClick},
    {'txt', id='x', text='', width=60},
    {'txt', id='y', text='', width=60},
    {'txt', id='z', text='', width=60},
    {'btn', id='ok', onclick=setPosClick},
    {'btn', id='cancel', closeswindow=true}
    },
    oncreate = setPosInit,
    onclose = closePositionWindow
    }


    function getPosCommand(cmd, playerName)
    local player, sentenceStart


    if playerName then
    player = getPlayerFromNick(playerName)
    if not player then
    errMsg('There is no player named "' .. playerName .. '".')
    return
    end
    playerName = getPlayerName(player) -- make sure case is correct
    sentenceStart = playerName .. ' is '
    else
    player = g_Me
    sentenceStart = 'You are '
    end


    local px, py, pz = getElementPosition(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
    outputChatBox(sentenceStart .. 'in a ' .. getVehicleName(vehicle), 0, 255, 0)
    else
    outputChatBox(sentenceStart .. 'on foot', 0, 255, 0)
    end
    outputChatBox(sentenceStart .. 'at (' .. px .. ', ' .. py .. ', ' .. pz .. ')', 0, 255, 0)
    end
    addCommandHandler('getpos', getPosCommand)
    addCommandHandler('gp', getPosCommand)


    function setPosCommand(cmd, x, y, z)
    local px, py, pz = getElementPosition(g_Me)
    if not x or x == '-' or not tonumber(x) then
    x = px
    end
    if not y or y == '-' or not tonumber(y) then
    y = py
    end
    if not z or z == '-' or not tonumber(z) then
    z = pz
    end
    setPlayerPosition(tonumber(x), tonumber(y), tonumber(z))
    end
    addCommandHandler('setpos', setPosCommand)
    addCommandHandler('sp', setPosCommand)


    ---------------------------
    -- Spawn map window
    ---------------------------
    function warpMapInit()
    addEventHandler('onClientRender', g_Root, updatePlayerBlips)
    end


    function spawnMapDoubleClick(relX, relY)
    setPlayerPosition(relX*6000 - 3000, 3000 - relY*6000, 0)
    closeWindow(wndSpawnMap)
    end


    function closeSpawnMap()
    showCursor(false)
    removeEventHandler('onClientRender', g_Root, updatePlayerBlips)
    for elem,data in pairs(g_PlayerData) do
    for i,name in ipairs({'mapBlip', 'mapLabelShadow', 'mapLabel'}) do
    if data.gui[name] then
    destroyElement(data.gui[name])
    data.gui[name] = nil
    end
    end
    end
    end


    wndSpawnMap = {
    'wnd',
    text = 'Select spawn position',
    width = g_MapSide + 20,
    controls = {
    {'img', id='map', src='map.png', width=g_MapSide, height=g_MapSide, ondoubleclick=spawnMapDoubleClick},
    {'lbl', text='Welcome to freeroam. Double click a location on the map to spawn.', width=g_MapSide-60, align='center'},
    {'btn', id='close', closeswindow=true}
    },
    oncreate = warpMapInit,
    onclose = closeSpawnMap
    }

    Ich habe mir letztens einen server gemacht mit der freeroam game ressource,


    aber ich kann nicht spawnen. das ist bei jeder ressource z.b. ctf so! :cursing:


    Ich weis nicht ich verstehe nicht so viel davon, ich habe bis dahin alles hinbekommen adminpanel usw. aber ich kann einfach nicht rein muss man da noch ne map auswählen oder so? ?(



    mfg Homie3