@@ -172,7 +172,7 @@ function renderClassSelText()
172
172
drawShadowText (' Use left and right arrow keys to select class.' , 20 , screenHeight - 150 , tocolor (240 , 240 , 240 ))
173
173
drawShadowText (' Press SHIFT when ready to spawn.' , 20 , screenHeight - 136 , tocolor (240 , 240 , 240 ))
174
174
175
- if not g_ClassSelectionInfo or not g_ClassSelectionInfo .selectedclass then
175
+ if not g_ClassSelectionInfo [ 0 ] or not g_ClassSelectionInfo .selectedclass then
176
176
return
177
177
end
178
178
drawShadowText (' Class ' .. g_ClassSelectionInfo .selectedclass .. ' weapons:' , 20 , screenHeight - 110 , tocolor (240 , 240 , 240 ))
@@ -333,6 +333,9 @@ function camAttachRender()
333
333
local x1 ,y1 ,z1 = 0.0 , 0.0 , 0.0
334
334
if ca .objCamPos ~= nil then
335
335
x1 ,y1 ,z1 = getElementPosition (ca .objCamPos )
336
+ if not x1 then x1 = 0.0 end
337
+ if not y1 then y1 = 0.0 end
338
+ if not z1 then z1 = 0.0 end
336
339
end
337
340
local camDist = ca .dist
338
341
local cosZ = math.cos (ca .z )
@@ -402,9 +405,15 @@ function camRender()
402
405
local x1 ,y1 ,z1 ,x2 ,y2 ,z2 = 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0
403
406
if sm .objCamPos ~= nil then
404
407
x1 ,y1 ,z1 = getElementPosition (sm .objCamPos )
408
+ if not x1 then x1 = 0.0 end
409
+ if not y1 then y1 = 0.0 end
410
+ if not z1 then z1 = 0.0 end
405
411
end
406
412
if sm .objLookAt ~= nil then
407
413
x2 ,y2 ,z2 = getElementPosition (sm .objLookAt )
414
+ if not x2 then x2 = 0.0 end
415
+ if not y2 then y2 = 0.0 end
416
+ if not z2 then z2 = 0.0 end
408
417
end
409
418
-- outputConsole(string.format("Current Camera Matrix is: CamPos: %f %f %f CamLookAt: %f %f %f", x1,y1,z1,x2,y2,z2))
410
419
setCameraMatrix (x1 ,y1 ,z1 ,x2 ,y2 ,z2 )
453
462
function AttachPlayerObjectToPlayer (objID , attachPlayer , offsetX , offsetY , offsetZ , rX , rY , rZ )
454
463
local obj = g_PlayerObjects [objID ]
455
464
if not obj then
456
- return
465
+ return false
457
466
end
458
467
attachElements (obj , attachPlayer , offsetX , offsetY , offsetZ , rX , rY , rZ )
468
+ return true
459
469
end
460
470
461
471
function CreatePlayerObject (objID , model , x , y , z , rX , rY , rZ )
@@ -483,25 +493,28 @@ end
483
493
function SetPlayerObjectPos (objID , x , y , z )
484
494
local obj = g_PlayerObjects [objID ]
485
495
if not obj then
486
- return
496
+ return false
487
497
end
488
498
setElementPosition (obj , x , y , z )
499
+ return true
489
500
end
490
501
491
502
function SetPlayerObjectRot (objID , rX , rY , rZ )
492
503
local obj = g_PlayerObjects [objID ]
493
504
if not obj then
494
- return
505
+ return false
495
506
end
496
507
setElementRotation (obj , rX , rY , rZ )
508
+ return true
497
509
end
498
510
499
511
function StopPlayerObject (objID )
500
512
local obj = g_PlayerObjects [objID ]
501
513
if not obj then
502
- return
514
+ return false
503
515
end
504
516
stopObject (obj )
517
+ return true
505
518
end
506
519
507
520
--- Audio
625
638
626
639
function SetPlayerPosFindZ (x , y , z )
627
640
setElementPosition (localPlayer , x , y , getGroundPosition (x , y , z ) + 1 )
641
+ return true
628
642
end
629
643
630
644
function SetVehicleParamsForPlayer (vehicle , isObjective , doorsLocked )
@@ -1565,7 +1579,9 @@ function RemovePlayerMapIcon(blipID)
1565
1579
if g_Blips [blipID ] then
1566
1580
destroyElement (g_Blips [blipID ])
1567
1581
g_Blips [blipID ] = nil
1582
+ return true
1568
1583
end
1584
+ return false
1569
1585
end
1570
1586
1571
1587
function SetPlayerMapIcon (blipID , x , y , z , type , r , g , b , a )
@@ -1574,6 +1590,7 @@ function SetPlayerMapIcon(blipID, x, y, z, type, r, g, b, a)
1574
1590
g_Blips [blipID ] = nil
1575
1591
end
1576
1592
g_Blips [blipID ] = createBlip (x , y , z , type , 2 , r , g , b , a )
1593
+ return true
1577
1594
end
1578
1595
1579
1596
function SetPlayerWorldBounds (xMax , xMin , yMax , yMin )
@@ -1658,6 +1675,7 @@ end
1658
1675
function TogglePlayerClock (toggle )
1659
1676
setMinuteDuration (toggle and 1000 or 2147483647 )
1660
1677
setPlayerHudComponentVisible (' clock' , toggle )
1678
+ return true
1661
1679
end
1662
1680
1663
1681
function createListDialog (titleText , message , button1txt , button2txt )
@@ -1706,8 +1724,8 @@ function createInputDialog(titleText, message, button1txt, button2txt)
1706
1724
end
1707
1725
inputDialog = nil
1708
1726
inputWindow = guiCreateWindow (screenWidth / 2 - 541 / 2 ,screenHeight / 2 - 352 / 2 ,541 ,352 , titleText , false )
1709
- guiWindowSetMovable (listWindow ,false )
1710
- guiWindowSetSizable (listWindow ,false )
1727
+ guiWindowSetMovable (inputWindow ,false )
1728
+ guiWindowSetSizable (inputWindow ,false )
1711
1729
inputLabel = guiCreateColoredLabel (0.1 , 0.1 , 1.0 , 0.8 , message , inputWindow , true )
1712
1730
inputEdit = guiCreateEdit (0.0 , 0.7 , 1.0 , 0.1 , " " , true , inputWindow )
1713
1731
@@ -1845,9 +1863,9 @@ function guiCreateColoredLabel(ax, ay, bx, by,str, parent, relative) --x, y, wid
1845
1863
local scrollpane = guiCreateScrollPane (ax ,ay ,bx ,by ,relative ,parent )
1846
1864
-- outputConsole('main string:' .. str)
1847
1865
1848
- local pat = " (.-)#(%x%x%x%x%x%x)"
1849
- local s , e , cap , col = str :find (pat , 1 )
1850
- local last = 1
1866
+ local pat = " (.-)#(%x%x%x%x%x%x)"
1867
+ local s , e , cap , col = str :find (pat , 1 )
1868
+ local last = 1
1851
1869
local labels = {}
1852
1870
local incy = 0
1853
1871
local incx = 0
@@ -1859,10 +1877,10 @@ function guiCreateColoredLabel(ax, ay, bx, by,str, parent, relative) --x, y, wid
1859
1877
1860
1878
lbl = guiCreateLabel (ax + incx , ay + incy , 1.0 , by , cap , relative , scrollpane )
1861
1879
guiLabelSetHorizontalAlign (lbl , " left" )
1862
- table.insert (labels , lbl )
1863
- if (r == nil ) then r = 255 end
1864
- if (g == nil ) then g = 255 end
1865
- if (b == nil ) then b = 255 end
1880
+ table.insert (labels , lbl )
1881
+ if (r == nil ) then r = 255 end
1882
+ if (g == nil ) then g = 255 end
1883
+ if (b == nil ) then b = 255 end
1866
1884
guiLabelSetColor (lbl ,r ,g ,b )
1867
1885
r ,g ,b = tonumber (" 0x" .. col :sub (1 , 2 )), tonumber (" 0x" .. col :sub (3 , 4 )), tonumber (" 0x" .. col :sub (5 , 6 ))
1868
1886
@@ -1891,6 +1909,9 @@ function guiCreateColoredLabel(ax, ay, bx, by,str, parent, relative) --x, y, wid
1891
1909
cap = str :sub (last )
1892
1910
lbl2 = guiCreateLabel (ax + incx , ay + incy , 1.0 , by , cap , relative , scrollpane )
1893
1911
table.insert (labels , lbl2 )
1912
+ if (r == nil ) then r = 255 end
1913
+ if (g == nil ) then g = 255 end
1914
+ if (b == nil ) then b = 255 end
1894
1915
guiLabelSetColor (lbl2 ,r ,g ,b )
1895
1916
end
1896
1917
return labels
@@ -1934,7 +1955,7 @@ function ShowPlayerDialog(dialogid, dialogtype, caption, info, button1, button2)
1934
1955
local row = guiGridListAddRow ( listGrid )
1935
1956
guiGridListSetItemText ( listGrid , row , listColumn , v , false , true )
1936
1957
end
1937
- return
1958
+ return true
1938
1959
end
1939
1960
1940
1961
-- DIALOG_STYLE_TABLIST, DIALOG_STYLE_TABLIST_HEADER
@@ -1943,7 +1964,7 @@ function ShowPlayerDialog(dialogid, dialogtype, caption, info, button1, button2)
1943
1964
if # items < 1 then
1944
1965
outputConsole (' Error, your dialog either has no items, its format is wrong or you\' re missing a newline character in the string' )
1945
1966
outputConsole (' The raw string was: ' .. info )
1946
- return -- Abort if there's no items
1967
+ return false -- Abort if there's no items
1947
1968
end
1948
1969
1949
1970
-- Create the header
@@ -1967,6 +1988,7 @@ function ShowPlayerDialog(dialogid, dialogtype, caption, info, button1, button2)
1967
1988
end
1968
1989
end
1969
1990
end
1991
+ return true
1970
1992
end
1971
1993
1972
1994
addEvent (" onPlayerClickPlayer" )
0 commit comments