Jump to content

[HELP] Player freezes for a few seconds after spawning


Recommended Posts

Hi, guys. I need some help. I made a marker script and whenever someone enters the marker and spawns somewhere else, they are frozen for 4 seconds and I need to know how to fix that.

Here is the code:

EDIT: You need a certain map for that.

But does someone know why I got that problem? It happened in a map that had many objects in dimension 0. It doesn't happen when it's in a new map.

Link to comment

its because of the server Syncing with the client and this causes basically a stream sluggishness so there is always going to be a lag with it, but you could have a setTimer variable with your script?

we can't help if you haven't posted the code

Link to comment

Ok, here you go:

  
local marker = {} 
  
local markerTable = { 
--x, y, z, r, g, b, dim, x1, y1, z1, rotation, int, dimension 
{1788.73, -1296.87, 13.41, 255, 255, 0, 0, 1811.22, -1298.09, 22.24, 0, 0, 0}, -- Entrance marker, spawns to 1st floor | First coordinates indicate where the marker is located. Second coordinates indicate where the player will spawn. Do not put the exact spawn coordinates the same as the marker coordinates, otherwise you will get a C Stack Overflow error or it'll just spawn you somewhere else. 
{1811.17, -1300.80, 22.24, 255, 255, 0, 0, 1791.13, -1292.97, 13.54, 0, 0, 0}, -- 1st floor Down marker, spawns to entrance 
{1811.17, -1300.80, 27.70, 255, 255, 0, 0, 1811.22, -1298.09, 22.24, 0, 0, 0}, -- 2nd floor Down marker, spawns to 1st floor  
{1811.17, -1300.80, 33.16, 255, 255, 0, 0, 1811.22, -1298.09, 27.70, 0, 0, 0}, -- 3rd floor Down marker, spawns to 2rd floor 
{1811.17, -1300.89, 38.62, 255, 255, 0, 0, 1811.22, -1298.09, 33.16, 0, 0, 0}, -- 4th floor Down marker, spawns to 3rd floor 
{1811.17, -1300.89, 44.09, 255, 255, 0, 0, 1811.22, -1298.09, 38.62, 0, 0, 0}, -- 5th floor Down marker, spawns to 4th floor 
{1811.17, -1300.89, 49.47, 255, 255, 0, 0, 1811.22, -1298.09, 44.09, 0, 0, 0}, -- 6th floor Down marker, spawns to 5th floor 
{1811.17, -1300.89, 54.93, 255, 255, 0, 0, 1811.22, -1298.09, 49.47, 0, 0, 0}, -- 7th floor Down marker, spawns to 6th floor 
{1811.17, -1300.89, 60.40, 255, 255, 0, 0, 1811.22, -1298.09, 54.93, 0, 0, 0}, -- 8th floor Down marker, spawns to 7th floor 
{1811.17, -1300.89, 65.85, 255, 255, 0, 0, 1811.22, -1298.09, 60.40, 0, 0, 0}, -- 9th floor Down marker, spawns to 8th floor 
{1811.17, -1300.89, 71.31, 255, 255, 0, 0, 1811.22, -1298.09, 65.85, 0, 0, 0}, -- 10th floor Down marker, spawns to 9th floor 
{1811.17, -1300.89, 76.70, 255, 255, 0, 0, 1811.22, -1298.09, 71.31, 0, 0, 0}, -- 11th floor Down marker, spawns to 10th floor 
{1811.17, -1300.89, 82.17, 255, 255, 0, 0, 1811.22, -1298.09, 76.70, 0, 0, 0}, -- 12th floor Down marker, spawns to 11th floor 
{1811.17, -1300.89, 87.62, 255, 255, 0, 0, 1811.22, -1298.09, 82.17, 0, 0, 0}, -- 13th floor Down marker, spawns to 12th floor 
{1811.17, -1300.89, 93.09, 255, 255, 0, 0, 1811.22, -1298.09, 87.62, 0, 0, 0}, -- 14th floor Down marker, spawns to 13th floor 
{1811.17, -1300.89, 98.54, 255, 255, 0, 0, 1811.22, -1298.09, 93.09, 0, 0, 0}, -- 15th floor Down marker, spawns to 14th floor 
{1811.17, -1300.89, 103.93, 255, 255, 0, 0, 1811.22, -1298.09, 98.54, 0, 0, 0}, -- 16th floor Down marker, spawns to 15th floor 
{1811.17, -1300.89, 109.40, 255, 255, 0, 0, 1811.22, -1298.09, 103.93, 0, 0, 0}, -- 17th floor Down marker, spawns to 16th floor 
{1811.17, -1300.89, 114.85, 255, 255, 0, 0, 1811.22, -1298.09, 109.30, 0, 0, 0}, -- 18th floor Down marker, spawns to 17th floor 
{1811.17, -1300.89, 120.30, 255, 255, 0, 0, 1811.22, -1299.09, 114.85, 0, 0, 0}, -- 19th floor Down marker, spawns to 18th floor 
{1825.17, -1299.39, 22.24, 255, 255, 0, 0, 1827.09, -1299.36, 27.70, 0, 0, 0}, -- 1st floor Up marker, spawns to 2nd floor 
{1825.17, -1299.39, 27.70, 255, 255, 0, 0, 1827.09, -1299.36, 33.16, 0, 0, 0}, -- 2nd floor Up marker, spawns to 3rd floor 
{1825.17, -1299.39, 33.16, 255, 255, 0, 0, 1827.09, -1299.36, 38.62, 0, 0, 0}, -- 3rd floor Up marker, spawns to 4th floor 
{1825.17, -1299.39, 38.62, 255, 255, 0, 0, 1827.09, -1299.36, 44.07, 0, 0, 0}, -- 4th floor Up marker, spawns to 5th floor 
{1825.17, -1299.39, 44.09, 255, 255, 0, 0, 1827.09, -1299.36, 49.47, 0, 0, 0}, -- 5th floor Up marker, spawns to 6th floor 
{1825.17, -1299.39, 49.47, 255, 255, 0, 0, 1827.09, -1299.36, 54.93, 0, 0, 0}, -- 6th floor Up marker, spawns to 7th floor 
{1825.17, -1299.39, 54.93, 255, 255, 0, 0, 1827.09, -1299.36, 60.40, 0, 0, 0}, -- 7th floor Up marker, spawns to 8th floor 
{1825.17, -1299.39, 60.40, 255, 255, 0, 0, 1827.09, -1299.36, 65.85, 0, 0, 0}, -- 8th floor Up marker, spawns to 9th floor 
{1825.17, -1299.39, 65.85, 255, 255, 0, 0, 1827.09, -1299.36, 71.31, 0, 0, 0}, -- 9th floor Up marker, spawns to 10th floor 
{1825.17, -1299.39, 71.31, 255, 255, 0, 0, 1827.09, -1299.36, 76.70, 0, 0, 0}, -- 10th floor Up marker, spawns to 11th floor 
{1825.17, -1299.39, 76.70, 255, 255, 0, 0, 1827.09, -1299.36, 82.17, 0, 0, 0}, -- 11th floor Up marker, spawns to 12th floor 
{1825.17, -1299.39, 82.17, 255, 255, 0, 0, 1827.09, -1299.36, 87.62, 0, 0, 0}, -- 12th floor Up marker, spawns to 13th floor 
{1825.17, -1299.39, 87.62, 255, 255, 0, 0, 1827.09, -1299.36, 93.09, 0, 0, 0}, -- 13th floor Up marker, spawns to 14th floor 
{1825.17, -1299.39, 93.09, 255, 255, 0, 0, 1827.09, -1299.36, 98.54, 0, 0, 0}, -- 14th floor Up marker, spawns to 15th floor 
{1825.17, -1299.39, 98.54, 255, 255, 0, 0, 1827.09, -1299.36, 103.93, 0, 0, 0}, -- 15th floor Up marker, spawns to 16th floor 
{1825.17, -1299.39, 103.93, 255, 255, 0, 0, 1827.09, -1299.36, 109.40, 0, 0, 0}, -- 16th floor Up marker, spawns to 17th floor 
{1825.17, -1299.39, 109.30, 255, 255, 0, 0, 1827.09, -1299.36, 114.85, 0, 0, 0}, -- 17th floor Up marker, spawns to 18th floor 
{1825.17, -1299.39, 114.85, 255, 255, 0, 0, 1827.09, -1299.36, 120.30, 0, 0, 0}, -- 18th floor Up marker, spawns to 19th floor 
--[[ {1825.17, -1299.39, 120.30, 255, 255, 0, 0, 1827.09, -1299.36, } -- 19th floor Up marker, spawns to top of building --]] 
} 
  
function teleporter(hitElement) 
    local markerIndex = getElementData(source, "markerIndex") 
    local plrSkin = getElementModel(hitElement) 
    local rotation = markerTable[markerIndex][11] 
    local int = markerTable[markerIndex][12] 
    local dim = markerTable[markerIndex][13] 
    if (not getPedOccupiedVehicle(hitElement)) then 
        if (dim) then 
                spawnPlayer(hitElement, markerTable[markerIndex][8], markerTable[markerIndex][9], markerTable[markerIndex][10], rotation, plrSkin, int, dim) 
        else 
                spawnPlayer(hitElement, markerTable[markerIndex][8], markerTable[markerIndex][9], markerTable[markerIndex][10], rotation, plrSkin, int, 0) 
        end 
    end 
end 
  
for i=1, #markerTable do 
        local x, y, z, r, g, b, dim = markerTable[i][1], markerTable[i][2], markerTable[i][3], markerTable[i][4], markerTable[i][5], markerTable[i][6], markerTable[i][7] 
        marker[i] = createMarker(x, y, z + 1, "arrow", 2, r, g, b, 200) 
        setElementDimension(marker[i], dim) 
        setElementData(marker[i], "markerIndex", i) 
        addEventHandler("onMarkerHit", marker[i], teleporter) 
end 
  

Link to comment
local marker = {} 
  
local markerTable = { 
--x, y, z, r, g, b, dim, x1, y1, z1, rotation, int, dimension 
{1788.73, -1296.87, 13.41, 255, 255, 0, 0, 1811.22, -1298.09, 22.24, 0, 0, 0}, -- Entrance marker, spawns to 1st floor | First coordinates indicate where the marker is located. Second coordinates indicate where the player will spawn. Do not put the exact spawn coordinates the same as the marker coordinates, otherwise you will get a C Stack Overflow error or it'll just spawn you somewhere else. 
{1811.17, -1300.80, 22.24, 255, 255, 0, 0, 1791.13, -1292.97, 13.54, 0, 0, 0}, -- 1st floor Down marker, spawns to entrance 
{1811.17, -1300.80, 27.70, 255, 255, 0, 0, 1811.22, -1298.09, 22.24, 0, 0, 0}, -- 2nd floor Down marker, spawns to 1st floor  
{1811.17, -1300.80, 33.16, 255, 255, 0, 0, 1811.22, -1298.09, 27.70, 0, 0, 0}, -- 3rd floor Down marker, spawns to 2rd floor 
{1811.17, -1300.89, 38.62, 255, 255, 0, 0, 1811.22, -1298.09, 33.16, 0, 0, 0}, -- 4th floor Down marker, spawns to 3rd floor 
{1811.17, -1300.89, 44.09, 255, 255, 0, 0, 1811.22, -1298.09, 38.62, 0, 0, 0}, -- 5th floor Down marker, spawns to 4th floor 
{1811.17, -1300.89, 49.47, 255, 255, 0, 0, 1811.22, -1298.09, 44.09, 0, 0, 0}, -- 6th floor Down marker, spawns to 5th floor 
{1811.17, -1300.89, 54.93, 255, 255, 0, 0, 1811.22, -1298.09, 49.47, 0, 0, 0}, -- 7th floor Down marker, spawns to 6th floor 
{1811.17, -1300.89, 60.40, 255, 255, 0, 0, 1811.22, -1298.09, 54.93, 0, 0, 0}, -- 8th floor Down marker, spawns to 7th floor 
{1811.17, -1300.89, 65.85, 255, 255, 0, 0, 1811.22, -1298.09, 60.40, 0, 0, 0}, -- 9th floor Down marker, spawns to 8th floor 
{1811.17, -1300.89, 71.31, 255, 255, 0, 0, 1811.22, -1298.09, 65.85, 0, 0, 0}, -- 10th floor Down marker, spawns to 9th floor 
{1811.17, -1300.89, 76.70, 255, 255, 0, 0, 1811.22, -1298.09, 71.31, 0, 0, 0}, -- 11th floor Down marker, spawns to 10th floor 
{1811.17, -1300.89, 82.17, 255, 255, 0, 0, 1811.22, -1298.09, 76.70, 0, 0, 0}, -- 12th floor Down marker, spawns to 11th floor 
{1811.17, -1300.89, 87.62, 255, 255, 0, 0, 1811.22, -1298.09, 82.17, 0, 0, 0}, -- 13th floor Down marker, spawns to 12th floor 
{1811.17, -1300.89, 93.09, 255, 255, 0, 0, 1811.22, -1298.09, 87.62, 0, 0, 0}, -- 14th floor Down marker, spawns to 13th floor 
{1811.17, -1300.89, 98.54, 255, 255, 0, 0, 1811.22, -1298.09, 93.09, 0, 0, 0}, -- 15th floor Down marker, spawns to 14th floor 
{1811.17, -1300.89, 103.93, 255, 255, 0, 0, 1811.22, -1298.09, 98.54, 0, 0, 0}, -- 16th floor Down marker, spawns to 15th floor 
{1811.17, -1300.89, 109.40, 255, 255, 0, 0, 1811.22, -1298.09, 103.93, 0, 0, 0}, -- 17th floor Down marker, spawns to 16th floor 
{1811.17, -1300.89, 114.85, 255, 255, 0, 0, 1811.22, -1298.09, 109.30, 0, 0, 0}, -- 18th floor Down marker, spawns to 17th floor 
{1811.17, -1300.89, 120.30, 255, 255, 0, 0, 1811.22, -1299.09, 114.85, 0, 0, 0}, -- 19th floor Down marker, spawns to 18th floor 
{1825.17, -1299.39, 22.24, 255, 255, 0, 0, 1827.09, -1299.36, 27.70, 0, 0, 0}, -- 1st floor Up marker, spawns to 2nd floor 
{1825.17, -1299.39, 27.70, 255, 255, 0, 0, 1827.09, -1299.36, 33.16, 0, 0, 0}, -- 2nd floor Up marker, spawns to 3rd floor 
{1825.17, -1299.39, 33.16, 255, 255, 0, 0, 1827.09, -1299.36, 38.62, 0, 0, 0}, -- 3rd floor Up marker, spawns to 4th floor 
{1825.17, -1299.39, 38.62, 255, 255, 0, 0, 1827.09, -1299.36, 44.07, 0, 0, 0}, -- 4th floor Up marker, spawns to 5th floor 
{1825.17, -1299.39, 44.09, 255, 255, 0, 0, 1827.09, -1299.36, 49.47, 0, 0, 0}, -- 5th floor Up marker, spawns to 6th floor 
{1825.17, -1299.39, 49.47, 255, 255, 0, 0, 1827.09, -1299.36, 54.93, 0, 0, 0}, -- 6th floor Up marker, spawns to 7th floor 
{1825.17, -1299.39, 54.93, 255, 255, 0, 0, 1827.09, -1299.36, 60.40, 0, 0, 0}, -- 7th floor Up marker, spawns to 8th floor 
{1825.17, -1299.39, 60.40, 255, 255, 0, 0, 1827.09, -1299.36, 65.85, 0, 0, 0}, -- 8th floor Up marker, spawns to 9th floor 
{1825.17, -1299.39, 65.85, 255, 255, 0, 0, 1827.09, -1299.36, 71.31, 0, 0, 0}, -- 9th floor Up marker, spawns to 10th floor 
{1825.17, -1299.39, 71.31, 255, 255, 0, 0, 1827.09, -1299.36, 76.70, 0, 0, 0}, -- 10th floor Up marker, spawns to 11th floor 
{1825.17, -1299.39, 76.70, 255, 255, 0, 0, 1827.09, -1299.36, 82.17, 0, 0, 0}, -- 11th floor Up marker, spawns to 12th floor 
{1825.17, -1299.39, 82.17, 255, 255, 0, 0, 1827.09, -1299.36, 87.62, 0, 0, 0}, -- 12th floor Up marker, spawns to 13th floor 
{1825.17, -1299.39, 87.62, 255, 255, 0, 0, 1827.09, -1299.36, 93.09, 0, 0, 0}, -- 13th floor Up marker, spawns to 14th floor 
{1825.17, -1299.39, 93.09, 255, 255, 0, 0, 1827.09, -1299.36, 98.54, 0, 0, 0}, -- 14th floor Up marker, spawns to 15th floor 
{1825.17, -1299.39, 98.54, 255, 255, 0, 0, 1827.09, -1299.36, 103.93, 0, 0, 0}, -- 15th floor Up marker, spawns to 16th floor 
{1825.17, -1299.39, 103.93, 255, 255, 0, 0, 1827.09, -1299.36, 109.40, 0, 0, 0}, -- 16th floor Up marker, spawns to 17th floor 
{1825.17, -1299.39, 109.30, 255, 255, 0, 0, 1827.09, -1299.36, 114.85, 0, 0, 0}, -- 17th floor Up marker, spawns to 18th floor 
{1825.17, -1299.39, 114.85, 255, 255, 0, 0, 1827.09, -1299.36, 120.30, 0, 0, 0}, -- 18th floor Up marker, spawns to 19th floor 
--[[ {1825.17, -1299.39, 120.30, 255, 255, 0, 0, 1827.09, -1299.36, } -- 19th floor Up marker, spawns to top of building --]] 
} 
  
function teleporter(hitElement, spawn) 
    local markerIndex = getElementData(source, "markerIndex") 
    local plrSkin = getElementModel(hitElement) 
    local rotation = markerTable[markerIndex][11] 
    local int = markerTable[markerIndex][12] 
    local dim = markerTable[markerIndex][13] 
    if (not getPedOccupiedVehicle(hitElement)) then 
        if (dim) then 
                setElementPosition (hitElement, markerTable[markerIndex][8], markerTable[markerIndex][9], markerTable[markerIndex][10])------ edited this 
        else 
                setElementPosition (hitElement, markerTable[markerIndex][8], markerTable[markerIndex][9], markerTable[markerIndex][10])------ this aswell  
        end 
    end 
end 
  
for i=1, #markerTable do 
        local x, y, z, r, g, b, dim = markerTable[i][1], markerTable[i][2], markerTable[i][3], markerTable[i][4], markerTable[i][5], markerTable[i][6], markerTable[i][7] 
        marker[i] = createMarker(x, y, z + 1, "arrow", 2, r, g, b, 200) 
        setElementDimension(marker[i], dim) 
        setElementData(marker[i], "markerIndex", i) 
        addEventHandler("onMarkerHit", marker[i], teleporter) 
end 

when the player has to 'Spawn' it has to re spawn bassically in small terms so setElementPosition sets the element in you x,y,z co-ords instead of respawning

Cheers

Arnold-1 was on the right track and same mind set as me :D

Link to comment

With a little bit of playing around, I was able to set the dimension of the tower's objects to 1 and did setElementDimension to 1 (for spawning) with setElementPosition. Here is the new code:

  
local marker = {} 
  
local markerTable = { 
--x, y, z, r, g, b, dim, x1, y1, z1, rotation, int, dimension 
{1788.73, -1296.87, 13.41, 255, 255, 0, 0, 1811.22, -1298.09, 22.24, 0, 0, 1}, -- Entrance marker, spawns to 1st floor | First coordinates indicate where the marker is located. Second coordinates indicate where the player will spawn. Do not put the exact spawn coordinates the same as the marker coordinates, otherwise you will get a C Stack Overflow error or it'll just spawn you somewhere else. 
{1811.17, -1300.80, 22.24, 255, 255, 0, 1, 1791.13, -1292.97, 13.54, 0, 0, 1}, -- 1st floor Down marker, spawns to entrance 
{1811.17, -1300.80, 27.70, 255, 255, 0, 1, 1811.22, -1298.09, 22.24, 0, 0, 1}, -- 2nd floor Down marker, spawns to 1st floor  
{1811.17, -1300.80, 33.16, 255, 255, 0, 0, 1811.22, -1298.09, 27.70, 0, 0, 0}, -- 3rd floor Down marker, spawns to 2rd floor 
{1811.17, -1300.89, 38.62, 255, 255, 0, 0, 1811.22, -1298.09, 33.16, 0, 0, 0}, -- 4th floor Down marker, spawns to 3rd floor 
{1811.17, -1300.89, 44.09, 255, 255, 0, 0, 1811.22, -1298.09, 38.62, 0, 0, 0}, -- 5th floor Down marker, spawns to 4th floor 
{1811.17, -1300.89, 49.47, 255, 255, 0, 0, 1811.22, -1298.09, 44.09, 0, 0, 0}, -- 6th floor Down marker, spawns to 5th floor 
{1811.17, -1300.89, 54.93, 255, 255, 0, 0, 1811.22, -1298.09, 49.47, 0, 0, 0}, -- 7th floor Down marker, spawns to 6th floor 
{1811.17, -1300.89, 60.40, 255, 255, 0, 0, 1811.22, -1298.09, 54.93, 0, 0, 0}, -- 8th floor Down marker, spawns to 7th floor 
{1811.17, -1300.89, 65.85, 255, 255, 0, 0, 1811.22, -1298.09, 60.40, 0, 0, 0}, -- 9th floor Down marker, spawns to 8th floor 
{1811.17, -1300.89, 71.31, 255, 255, 0, 0, 1811.22, -1298.09, 65.85, 0, 0, 0}, -- 10th floor Down marker, spawns to 9th floor 
{1811.17, -1300.89, 76.70, 255, 255, 0, 0, 1811.22, -1298.09, 71.31, 0, 0, 0}, -- 11th floor Down marker, spawns to 10th floor 
{1811.17, -1300.89, 82.17, 255, 255, 0, 0, 1811.22, -1298.09, 76.70, 0, 0, 0}, -- 12th floor Down marker, spawns to 11th floor 
{1811.17, -1300.89, 87.62, 255, 255, 0, 0, 1811.22, -1298.09, 82.17, 0, 0, 0}, -- 13th floor Down marker, spawns to 12th floor 
{1811.17, -1300.89, 93.09, 255, 255, 0, 0, 1811.22, -1298.09, 87.62, 0, 0, 0}, -- 14th floor Down marker, spawns to 13th floor 
{1811.17, -1300.89, 98.54, 255, 255, 0, 0, 1811.22, -1298.09, 93.09, 0, 0, 0}, -- 15th floor Down marker, spawns to 14th floor 
{1811.17, -1300.89, 103.93, 255, 255, 0, 0, 1811.22, -1298.09, 98.54, 0, 0, 0}, -- 16th floor Down marker, spawns to 15th floor 
{1811.17, -1300.89, 109.40, 255, 255, 0, 0, 1811.22, -1298.09, 103.93, 0, 0, 0}, -- 17th floor Down marker, spawns to 16th floor 
{1811.17, -1300.89, 114.85, 255, 255, 0, 0, 1811.22, -1298.09, 109.30, 0, 0, 0}, -- 18th floor Down marker, spawns to 17th floor 
{1811.17, -1300.89, 120.30, 255, 255, 0, 0, 1811.22, -1299.09, 114.85, 0, 0, 0}, -- 19th floor Down marker, spawns to 18th floor 
{1825.17, -1299.39, 22.24, 255, 255, 0, 0, 1827.09, -1299.36, 27.70, 0, 0, 0}, -- 1st floor Up marker, spawns to 2nd floor 
{1825.17, -1299.39, 27.70, 255, 255, 0, 0, 1827.09, -1299.36, 33.16, 0, 0, 0}, -- 2nd floor Up marker, spawns to 3rd floor 
{1825.17, -1299.39, 33.16, 255, 255, 0, 0, 1827.09, -1299.36, 38.62, 0, 0, 0}, -- 3rd floor Up marker, spawns to 4th floor 
{1825.17, -1299.39, 38.62, 255, 255, 0, 0, 1827.09, -1299.36, 44.07, 0, 0, 0}, -- 4th floor Up marker, spawns to 5th floor 
{1825.17, -1299.39, 44.09, 255, 255, 0, 0, 1827.09, -1299.36, 49.47, 0, 0, 0}, -- 5th floor Up marker, spawns to 6th floor 
{1825.17, -1299.39, 49.47, 255, 255, 0, 0, 1827.09, -1299.36, 54.93, 0, 0, 0}, -- 6th floor Up marker, spawns to 7th floor 
{1825.17, -1299.39, 54.93, 255, 255, 0, 0, 1827.09, -1299.36, 60.40, 0, 0, 0}, -- 7th floor Up marker, spawns to 8th floor 
{1825.17, -1299.39, 60.40, 255, 255, 0, 0, 1827.09, -1299.36, 65.85, 0, 0, 0}, -- 8th floor Up marker, spawns to 9th floor 
{1825.17, -1299.39, 65.85, 255, 255, 0, 0, 1827.09, -1299.36, 71.31, 0, 0, 0}, -- 9th floor Up marker, spawns to 10th floor 
{1825.17, -1299.39, 71.31, 255, 255, 0, 0, 1827.09, -1299.36, 76.70, 0, 0, 0}, -- 10th floor Up marker, spawns to 11th floor 
{1825.17, -1299.39, 76.70, 255, 255, 0, 0, 1827.09, -1299.36, 82.17, 0, 0, 0}, -- 11th floor Up marker, spawns to 12th floor 
{1825.17, -1299.39, 82.17, 255, 255, 0, 0, 1827.09, -1299.36, 87.62, 0, 0, 0}, -- 12th floor Up marker, spawns to 13th floor 
{1825.17, -1299.39, 87.62, 255, 255, 0, 0, 1827.09, -1299.36, 93.09, 0, 0, 0}, -- 13th floor Up marker, spawns to 14th floor 
{1825.17, -1299.39, 93.09, 255, 255, 0, 0, 1827.09, -1299.36, 98.54, 0, 0, 0}, -- 14th floor Up marker, spawns to 15th floor 
{1825.17, -1299.39, 98.54, 255, 255, 0, 0, 1827.09, -1299.36, 103.93, 0, 0, 0}, -- 15th floor Up marker, spawns to 16th floor 
{1825.17, -1299.39, 103.93, 255, 255, 0, 0, 1827.09, -1299.36, 109.40, 0, 0, 0}, -- 16th floor Up marker, spawns to 17th floor 
{1825.17, -1299.39, 109.30, 255, 255, 0, 0, 1827.09, -1299.36, 114.85, 0, 0, 0}, -- 17th floor Up marker, spawns to 18th floor 
{1825.17, -1299.39, 114.85, 255, 255, 0, 0, 1827.09, -1299.36, 120.30, 0, 0, 0}, -- 18th floor Up marker, spawns to 19th floor 
--[[ {1825.17, -1299.39, 120.30, 255, 255, 0, 0, 1827.09, -1299.36, } -- 19th floor Up marker, spawns to top of building --]] 
} 
  
function teleporter(hitElement) 
    local markerIndex = getElementData(source, "markerIndex") 
    local plrSkin = getElementModel(hitElement) 
    local rotation = markerTable[markerIndex][11] 
    local int = markerTable[markerIndex][12] 
    local dim = markerTable[markerIndex][7] 
    local dim2 = markerTable[markerIndex][13] 
    if (not getPedOccupiedVehicle(hitElement)) then 
        if (dim) then 
                setElementDimension(hitElement, 1) 
                setElementPosition(hitElement, markerTable[markerIndex][8], markerTable[markerIndex][9], markerTable[markerIndex][10]) 
        else 
                setElementDimension(hitElement, 0) 
                setElementPosition(hitElement, markerTable[markerIndex][8], markerTable[markerIndex][9], markerTable[markerIndex][10]) 
        end 
    end 
end 
  
for i=1, #markerTable do 
        local x, y, z, r, g, b, dim = markerTable[i][1], markerTable[i][2], markerTable[i][3], markerTable[i][4], markerTable[i][5], markerTable[i][6], markerTable[i][7] 
        marker[i] = createMarker(x, y, z + 1, "arrow", 2, r, g, b, 200) 
        setElementData(marker[i], "markerIndex", i) 
        addEventHandler("onMarkerHit", marker[i], teleporter) 
end 
  

Only thing is now, I can't see the markers in dimension 1, but I can still spawn up or down by going to the marker's position. I can't see the dimensions of the markers :(

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