Jump to content

Help, Spawn Manger ,


Max+

Recommended Posts

Hello Guys i got Problem with spawnManger

i have but spawn point of Arena 20 it's Call on Admin Panel Police4 -- interior 3

but it's say

setElementInterior Expected element at argument 1 got nill ,

and it's spawn in the sky :(

-- Spawn manager , 
local spawns = { 
    { x = 238.6613311767, y = 141.05133056641, z = 1003.0234375 }; 
    { x = 190.87297058105, y =  158.49531555176, z = 1003.0234375 }; 
    { x = 298.23620605496, y =  172.01306152344, z = 1007.171875 }; 
} 
-- Spawn manager , 
function spawn ( uPed ) 
    local spawn = spawns [ math.random ( #spawns ) ] 
    local x, y, z = spawn.x, spawn.y, spawn.z 
    setElementInterior(uPed, 3, x, y, z) 
    setElementDimension(uPed, 0) 
    setTimer ( spawnPlayer, 2000, 1, uPed, x, y, z ) 
    setTimer ( fadeCamera, 3000, 1, uPed, true, 0.5 ) 
    setTimer ( setCameraTarget, 3000, 1, uPed, uPed ) 
    showCursor ( uPed, false ) 
end 
-- Spawn manager , 
  
  
addEventHandler ( 'onPlayerWasted', root, 
    function ( ) 
        fadeCamera ( source, false, 1.0, 0, 0, 0 ); 
        setTimer ( fadeCamera, 3500, 1, source, true, 0.5 ); 
        local spawn = spawns [ math.random ( #spawns ) ] 
        local x, y, z = spawn.x, spawn.y, spawn.z 
        setElementInterior(uPed, 3, x, y, z) 
        setElementDimension(uPed, 0) 
        setTimer ( spawnPlayer, 3000, 1, source, x, y, z ); 
    end 
) 

Link to comment

Ok try this server side

-- Spawn manager , 
local spawns = { 
    { 238.6613311767, 141.05133056641,  1003.0234375 }; 
    { 190.87297058105, 158.49531555176, 1003.0234375 }; 
    { 298.23620605496, 172.01306152344, 1007.171875 } 
} 
-- Spawn manager , 
function spawn ( player ) 
   if not isElement(player) then return end 
     x,y,z = unpack(spawns[math.random(#spawns)]) 
    setTimer ( spawnPlayer,3000,1,source, x, y, z,0,0,3,0 ); 
    setTimer ( fadeCamera, 3000, 1, player, true, 0.5 ) 
    setTimer ( setCameraTarget, 3000, 1, player, player ) 
    showCursor ( player, false ) 
end 
  
addEventHandler ( 'onPlayerWasted', root, 
    function (  ) 
        fadeCamera ( source, false, 1.0, 0, 0, 0 ); 
        setTimer ( fadeCamera, 3500, 1, source, true, 0.5 ); 
         x,y,z = unpack(spawns[math.random(#spawns)]) 
        setTimer ( spawnPlayer,3000,1,source, x, y, z,0,0,3,0 ); 
    end 
) 
Link to comment

Nope it's say server:11 Bad argument spawnPlayer ..

i tryed like this and same error ,

local respawn = { }; 
-- Spawn manager , 
local spawns = { 
    { x = 238.6613311767, y = 141.05133056641, z = 1003.0234375 }; 
    { x = 190.87297058105, y =  158.49531555176, z = 1003.0234375 }; 
    { x = 298.23620605496, y =  172.01306152344, z = 1007.171875 }; 
} 
-- Spawn manager , 
function spawn ( uPed ) 
    local x, y, z   unpack(spawns[math.random(#spawns)]) 
    setElementInterior(uPed, 3) 
    setTimer ( spawnPlayer, 2000, 1, uPed, x, y, z ) 
    setTimer ( fadeCamera, 3000, 1, uPed, true, 0.5 ) 
    setTimer ( setCameraTarget, 3000, 1, uPed, uPed ) 
    showCursor ( uPed, false ) 
end 
-- Spawn manager , 
  
  
addEventHandler ( 'onPlayerWasted', root, 
    function ( ) 
        fadeCamera ( source, false, 1.0, 0, 0, 0 ); 
        setTimer ( fadeCamera, 3500, 1, source, true, 0.5 ); 
        local x, y, z   unpack(spawns[math.random(#spawns)]) 
        setElementInterior(uPed, 3) 
        setTimer ( spawnPlayer, 3000, 1, source, x, y, z ); 
    end 
) 
  
-- Spawn manager , 

Link to comment

oh, sorry my bad try this :

-- Spawn manager , 
local spawns = { 
    { 238.6613311767, 141.05133056641,  1003.0234375 }; 
    { 190.87297058105, 158.49531555176, 1003.0234375 }; 
    { 298.23620605496, 172.01306152344, 1007.171875 } 
} 
-- Spawn manager , 
function spawn ( player ) 
   if not isElement(player) then return end 
     x,y,z = unpack(spawns[math.random(#spawns)]) 
    setTimer ( spawnPlayer,3000,1,player, x, y, z,0,0,3,0 ); 
    setTimer ( fadeCamera, 3000, 1, player, true, 0.5 ) 
    setTimer ( setCameraTarget, 3000, 1, player, player ) 
    showCursor ( player, false ) 
    end 
  
  
addEventHandler ( 'onPlayerWasted', root, 
    function (  ) 
        fadeCamera ( source, false, 1.0, 0, 0, 0 ); 
        setTimer ( fadeCamera, 3500, 1, source, true, 0.5 ); 
         x,y,z = unpack(spawns[math.random(#spawns)]) 
        setTimer ( spawnPlayer,3000,1,source, x, y, z,0,0,3,0 ); 
    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...