-
Notifications
You must be signed in to change notification settings - Fork 17
/
RCPMenu.lua
85 lines (78 loc) · 1.91 KB
/
RCPMenu.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cam = true
allowthird = false
allowthirdtoggle = true
b = 0
CreateThread( function()
while true do
Wait(0)
a = 1
if ((GetFollowPedCamViewMode() == 4) and (a == b) and (cam)) then
SendNUIMessage({ShowUI = true})
cam = false
elseif not ((GetFollowPedCamViewMode() == 4) and (a == b)) then
b = a
if (allowthird and allowthirdtoggle) then
SendNUIMessage({ShowUI = true})
allowthirdtoggle = false
elseif not allowthird then
SendNUIMessage({HideUI = true})
allowthirdtoggle = true
end
cam = true
end
end
end)
x = 0
weapon = true
CreateThread(function()
while true do
Wait(0)
w = GetSelectedPedWeapon(PlayerPedId())
if ((w ~= -1569615261) and (w == x) and (weapon)) then
SendNUIMessage({weapon = true})
weapon = false
elseif not (w == x) then
x = w
weapon = true
end
end
end)
RegisterNUICallback('togglethirdperson', function()
allowthird = not allowthird
end)
RegisterCommand('rcpaxon', function()
if GetFollowPedCamViewMode() == 4 then
SendNUIMessage({ShowPowerButton = true})
SetNuiFocus(true,true)
else
DrawTextWait()
end
end, false)
RegisterNUICallback('close', function()
SetNuiFocus(false)
end)
function DrawText(text,x,y)
SetTextFont(0)
SetTextProportional(0)
SetTextScale(0.35,0.35)
SetTextColour(255,0,0,255)--r,g,b,a
SetTextCentre(true)--true,false
SetTextDropshadow(1,0,0,0,200)--distance,r,g,b,a
SetTextEdge(1, 0, 0, 0, 255)
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(x,y)
end
function DrawTextWait()
toggletext = true
Wait(3000)
toggletext = false
end
CreateThread(function()
while true do
Wait(0)
if toggletext then
DrawText("You Need To Be In First Person",0.5,0.92)
end
end
end)