MatXpl Posted December 22, 2012 Share Posted December 22, 2012 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
Castillo Posted December 22, 2012 Share Posted December 22, 2012 Tried checking the result of the arguments you filled the camera function with? Link to comment
MatXpl Posted December 22, 2012 Author Share Posted December 22, 2012 i checked, its good (like in starting map) Link to comment
Castillo Posted December 22, 2012 Share Posted December 22, 2012 for k,v in ipairs(players) do setCameraMatrix(v,posX,posY,posZ,targetX,targetY,targetZ) fadeCamera ( v, true ) end Try that. Link to comment
MatXpl Posted December 23, 2012 Author Share Posted December 23, 2012 ohh thanks! it working topic can be closed look at me new problem please! viewtopic.php?f=91&t=51798 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now