Jump to content

working once ? O.o


MatXpl

Recommended Posts

function showCamera() 
local posX = getElementData(camera,"posX") 
local posY = getElementData(camera,"posY") 
local posZ = getElementData(camera,"posZ") 
local targetX = getElementData(camera,"targetX") 
local targetY = getElementData(camera,"targetY") 
local targetZ = getElementData(camera,"targetZ") 
    local players = getElementsByType("player") 
    for k,v in ipairs(players) do 
setCameraMatrix(v,posX,posY,posZ,targetX,targetY,targetZ) 
end 
end 
  
function onStealthPlayerJoin () 
     
    setElementData ( source, "Kills", 0 ) 
    setElementData ( source, "Deaths", 0 ) 
end 
  
addEventHandler ( "onPlayerJoin", getRootElement(), onStealthPlayerJoin ) 
  
function mapStart(startedMap) 
     
    setElementData ( team1, "Score", 0 ) 
    setElementData ( team2, "Score", 0 ) 
outputChatBox("Map loading...") 
outputChatBox("Odpalamy mape: "..getResourceName(startedMap)) 
    currentmap = startedMap 
    local maptime = get(getResourceName(currentmap)..".#time") 
--missionTimer = exports.missiontimer:createMissionTimer (maptime,true,"%m:%s",0.5,20,true,"default-bold",1,255,255,255) 
    local mapweather = get(getResourceName(currentmap)..".#weather") 
    if mapweather then 
        setWeather (mapweather) 
    end 
    local mapwaves = get(getResourceName(currentmap)..".#waveheight") 
    if mapwaves then 
        setWaveHeight ( mapwaves ) 
    end 
    local mapspeed = get(getResourceName(currentmap)..".#gamespeed") 
    if mapspeed then 
        setGameSpeed ( mapspeed ) 
    end 
    local mapgravity = get(getResourceName(currentmap)..".#gravity") 
    if mapgravity then 
        setGravity ( mapgravity ) 
    end  
  
  
        local cameraInfo = get(getResourceName(currentmap)..".camera") 
  
if not (camera) then 
camera = createElement("camera") 
end 
        setElementData ( camera, "posX", cameraInfo[1][1] ) 
        setElementData ( camera, "posY", cameraInfo[1][2] ) 
        setElementData ( camera, "posZ", cameraInfo[1][3] ) 
        setElementData ( camera, "targetX", cameraInfo[2][1] ) 
        setElementData ( camera, "targetY", cameraInfo[2][2] ) 
        setElementData ( camera, "targetZ", cameraInfo[2][3] ) 
outputChatBox(cameraInfo[1][1]) 
outputChatBox(cameraInfo[1][2]) 
outputChatBox(cameraInfo[1][3]) 
outputChatBox(cameraInfo[2][1]) 
outputChatBox(cameraInfo[2][2]) 
outputChatBox(cameraInfo[2][3]) 
  
showCamera() 
end 
  
addEventHandler( "onGamemodeMapStart", getRootElement(), mapStart) 

Ok, i start this resource first map is good it sets camera matrix but when i start second map its only black screen what is wrong? (its partly from stealth gamemode)

PS: In .map files is all right!

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