Skip to content

Commit f884c19

Browse files
committed
Minor fixes (camera)
- Code formatting - Typos
1 parent 7df3396 commit f884c19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+124
-127
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
function addRednessOnDamage ( )
2-
fadeCamera ( source, false, 1.0, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second
3-
setTimer ( fadeCameraDelayed, 500, 1, source ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal
1+
function addRednessOnDamage()
2+
fadeCamera(source, false, 1.0, 255, 0, 0) -- fade the player's camera to red over a period of 1 second
3+
setTimer(fadeCameraDelayed, 500, 1, source) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal
44
end
5-
addEventHandler ( "onPlayerDamage", root, addRednessOnDamage )
5+
addEventHandler("onPlayerDamage", root, addRednessOnDamage)
66

77
function fadeCameraDelayed(player) -- This function prevents debug warnings when the player disconnects while the timer is running.
8-
if (isElement(player)) then
9-
fadeCamera(player, true, 0.5)
10-
end
11-
end
8+
if (isElement(player)) then
9+
fadeCamera(player, true, 0.5)
10+
end
11+
end
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
function addRednessOnDamage ( )
2-
source:fadeCamera( false, 1.0, 255, 0, 0 ) -- fade the player's camera to red over a period of 1 second
3-
Timer ( fadeCameraDelayed, 500, 1, source ) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal
1+
function addRednessOnDamage()
2+
source:fadeCamera(false, 1.0, 255, 0, 0) -- fade the player's camera to red over a period of 1 second
3+
Timer(fadeCameraDelayed, 500, 1, source) -- don't let it go to opaque red, interrupt it after half a second and fade back to normal
44
end
5-
addEventHandler ( "onPlayerDamage", root, addRednessOnDamage )
5+
addEventHandler("onPlayerDamage", root, addRednessOnDamage)
66

77
function fadeCameraDelayed(player) -- This function prevents debug warnings when the player disconnects while the timer is running.
8-
if (isElement(player)) then
9-
player:fadeCamera(true, 0.5)
10-
end
11-
end
8+
if (isElement(player)) then
9+
player:fadeCamera(true, 0.5)
10+
end
11+
end
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
local cam = getCamera()
2-
setElementPosition( cam, 0,0,0 ) -- Clear camera target
2+
setElementPosition(cam, 0, 0, 0) -- Clear camera target
33
local myVehicle = getPedOccupiedVehicle(localPlayer)
4-
attachElements( cam, myVehicle, 0,-4,2, -20,0,0 )
4+
attachElements(cam, myVehicle, 0, -4, 2, -20, 0, 0)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function checkClipStatus()
22
local obj, veh = getCameraClip()
3-
outputChatBox ("Your camera can" .. (veh and "" or "not") .. "see the vehicle interior at the moment!",255,0,0,false)
4-
outputChatBox ("Your camera can" .. (obj and "" or "not") .. "collide with objects at the moment!",255,0,0,false)
3+
outputChatBox("Your camera can" .. (veh and "" or "not") .. "see the vehicle interior at the moment!", 255, 0, 0, false)
4+
outputChatBox("Your camera can" .. (obj and "" or "not") .. "collide with objects at the moment!", 255, 0, 0, false)
55
end
66
addEventHandler("clipstatus",checkClipStatus)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function checkClipStatus()
22
local obj, veh = Camera.getClip()
3-
outputChatBox ("Your camera can" .. (veh and "" or "not") .. "see the vehicle interior at the moment!",255,0,0,false)
4-
outputChatBox ("Your camera can" .. (obj and "" or "not") .. "collide with objects at the moment!",255,0,0,false)
3+
outputChatBox("Your camera can" .. (veh and "" or "not") .. "see the vehicle interior at the moment!", 255, 0, 0, false)
4+
outputChatBox("Your camera can" .. (obj and "" or "not") .. "collide with objects at the moment!", 255, 0, 0, false)
55
end
66
addEventHandler("clipstatus",checkClipStatus)

functions/Camera/examples/getCameraGoggleEffect-1.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ function nightvision()
55
setCameraGoggleEffect("normal")
66
end
77
end
8-
98
addCommandHandler("nightvision", nightvision)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function outputCameraInterior ( command )
2-
local interior = getCameraInterior()
3-
outputChatBox ( "The camera is in the interior " .. interior, localPlayer, 255, 255, 0 )
1+
function outputCameraInterior(command)
2+
local interior = getCameraInterior()
3+
outputChatBox("The camera is in the interior " .. interior, localPlayer, 255, 255, 0)
44
end
5-
addCommandHandler ( "camera", outputCameraInterior )
5+
addCommandHandler("camera", outputCameraInterior)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function outputCameraInterior ( player, command )
2-
local interior = getCameraInterior ( player )
3-
outputChatBox ( "The camera is in the interior " .. interior, player, 255, 255, 0 )
1+
function outputCameraInterior(player, command)
2+
local interior = getCameraInterior(player)
3+
outputChatBox("The camera is in the interior " .. interior, player, 255, 255, 0)
44
end
5-
addCommandHandler ( "camera", outputCameraInterior )
5+
addCommandHandler("camera", outputCameraInterior)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function outputCameraInterior ( command )
2-
local interior = Camera.interior -- or Camera.getInterior()
3-
outputChatBox ( "The camera is in the interior " .. interior, localPlayer, 255, 255, 0 )
1+
function outputCameraInterior(command)
2+
local interior = Camera.interior -- or Camera.getInterior()
3+
outputChatBox("The camera is in the interior " .. interior, localPlayer, 255, 255, 0)
44
end
5-
addCommandHandler ( "camera", outputCameraInterior )
5+
addCommandHandler("camera", outputCameraInterior)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function outputCameraInterior ( player, command )
2-
local interior = player.cameraInterior -- or player:getCameraInterior()
3-
outputChatBox ( "The camera is in the interior " .. interior, player, 255, 255, 0 )
1+
function outputCameraInterior(player, command)
2+
local interior = player.cameraInterior -- or player:getCameraInterior()
3+
outputChatBox("The camera is in the interior " .. interior, player, 255, 255, 0)
44
end
5-
addCommandHandler ( "camera", outputCameraInterior )
5+
addCommandHandler("camera", outputCameraInterior)

0 commit comments

Comments
 (0)