Skip to content

Commit 3a91e43

Browse files
authoredDec 21, 2020
Add files via upload
1 parent d244e93 commit 3a91e43

13 files changed

+1595
-0
lines changed
 

‎CRespawnWastedUser.lua

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
local x,y = guiGetScreenSize()
2+
opeWinH = {bb = {}}
3+
4+
5+
function msg(int)
6+
if int then
7+
outputChatBox(int,0,255,0,true)
8+
end
9+
end
10+
11+
12+
local player = getLocalPlayer()
13+
local px = x/x
14+
DGS = exports.dgs
15+
fonts = {
16+
text = dxCreateFont("font.ttf", 10*px, false, "antialiased"),
17+
mtext = dxCreateFont("font.ttf", 8*px, false, "antialiased"),
18+
Rtext = dxCreateFont("font.ttf", 95*px, false, "antialiased"),
19+
}
20+
21+
local r1,r2 = 400,125
22+
local p1,p2 = x/2-r1/2,y/2-r2/2
23+
local posDx1,posDx2 = x/2-r1/2,y/2-r2/2
24+
25+
function createMarkers()
26+
for i,v in ipairs(SmerTpositions) do
27+
myMarker = createMarker(v[1],v[2],v[3],'Corona',1,255,0,0,100)
28+
end
29+
end
30+
createMarkers()
31+
32+
33+
addEventHandler ( "onClientRender", root,
34+
function ( )
35+
for k,v in ipairs(SmerTpositions) do
36+
local x,y,z = v[1],v[2],v[3]+2
37+
local x1,y1,z1 = v[1],v[2],v[3]+0.5
38+
local px,py,pz = getElementPosition(getLocalPlayer())
39+
local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz )
40+
local Mx, My, Mz = getCameraMatrix()
41+
if ( getDistanceBetweenPoints3D ( x,y,z, getElementPosition ( localPlayer ) ) ) < 154 then
42+
local coords = { getScreenFromWorldPosition ( x,y,z+1 ) }
43+
if coords[1] and coords[2] then
44+
45+
if processLineOfSight(x1,y1,z1, Mx, My, Mz, true, false, false, true, false, true) then break end
46+
local dist = math.ceil(getDistanceBetweenPoints3D(px,py,pz,v[1],v[2],v[3]))
47+
dxDrawText ("id markers: "..k.."\nРастояние: "..dist.."м", coords[1], coords[2], coords[1], coords[2], tocolor(255,255,255), math.min ( 0.4*(15/distance)/1.4,1), fonts.Rtext,"center" )
48+
end
49+
end
50+
end
51+
end)
52+
53+
54+
55+
56+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
57+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
58+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
59+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
60+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
61+
62+
sTime = 10
63+
time = sTime
64+
65+
66+
67+
function tt ()
68+
tempo = setTimer (function()
69+
70+
time = time - 1
71+
72+
73+
if time == 0 then
74+
killTimer(tempo)
75+
76+
end
77+
end, 1000, sTime)
78+
end
79+
80+
81+
function RenderWastedMessage()
82+
83+
dxDrawRectangleCr(posDx1,posDx2,r1,r2-105,5,tocolor(10,10,10,150))
84+
dxDrawRectangleCr(x/2-r1/2,y/2-r2/2,r1,r2,5,tocolor(25,25,25,125))
85+
86+
dxDrawText ("Вы погибли - выберите действие",x/2,p2,x/2,p2, tocolor ( 255, 255, 255, 255 ), 1, 1, fonts.text,"center",nil )
87+
dxDrawText ("Вы окажитесь в больнице через: "..time.."с.",x/2,p2+35,x/2,p2+35, tocolor ( 255, 255, 255, 255 ), 1, 1, fonts.mtext,"center",nil )
88+
end
89+
90+
function createButtonsW()
91+
showCursor(true)
92+
93+
opeWinH.bb[1] = DGS:dgsCreateButton(x/2-150,p2+75,125, 33.5, "Ждать скорую", false, false,nil,nil,nil,nil,nil,nil,tocolor(0,255,0,25),tocolor(0,255,0,200),tocolor(0,100,0,200))
94+
opeWinH.bb[2] = DGS:dgsCreateButton(x/2+25,p2+75,125, 33.5, "Умереть", false, false,nil,nil,nil,nil,nil,nil,tocolor(255,0,0,25),tocolor(255,0,0,200),tocolor(100,0,0,200))
95+
96+
for i=1,2 do
97+
DGS:dgsSetFont (opeWinH.bb[i],fonts.mtext)
98+
end
99+
end
100+
101+
102+
103+
104+
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(),
105+
function()
106+
tt()
107+
end)
108+
109+
function triggeredResp()
110+
triggerServerEvent ( "spawnUserHeal", resourceRoot, getLocalPlayer() )
111+
end
112+
113+
114+
115+
function op()
116+
addEventHandler("onClientRender",root,RenderWastedMessage)
117+
createButtonsW()
118+
end
119+
120+
121+
function bbind()
122+
end
123+
bindKey( "SPACE", "up", bbind )
124+
125+
126+
127+
128+
function CloseWasted()
129+
showCursor(false)
130+
for i=1,2 do
131+
if isElement(opeWinH.bb[i]) then
132+
destroyElement(opeWinH.bb[i])
133+
removeEventHandler("onClientRender",root,RenderWastedMessage)
134+
end
135+
end
136+
end
137+
138+
139+
140+
function clickRegister(button,state)
141+
if button == "left" and state == "up" then
142+
if source == opeWinH.bb[1] then
143+
------------------------------------
144+
145+
------------------------------------
146+
elseif source == opeWinH.bb[2] then
147+
------------------------------------
148+
149+
------------------------------------
150+
end
151+
end
152+
end
153+
addEventHandler("onDgsMouseClick",root,clickRegister)
154+
155+
156+
157+
158+
159+
160+
161+
162+
163+
----------------------------------------------------------------------------------------------------
164+
----------------------------------------------------------------------------------------------------
165+
----------------------------------------------------------------------------------------------------
166+
----------------------------------------------------------------------------------------------------
167+
----------------------------------------------------------------------------------------------------
168+
----------------------------------------------------------------------------------------------------
169+
170+
function round(num)
171+
if ( num >= 0 ) then return math.floor( num + .5 )
172+
else return math.ceil( num - .5 ) end
173+
end
174+
175+
function dxDrawCorner( x, y, r, color, corner, postGUI )
176+
local corner = corner or 1
177+
local start = corner % 2 == 0 and 0 or -r
178+
local stop = corner % 2 == 0 and r or 0
179+
local m = corner > 2 and -1 or 1
180+
local h = ( corner == 1 or corner == 3 ) and -1 or 1
181+
for yoff = start, stop do
182+
local xoff = math.sqrt( r * r - yoff * yoff ) * m
183+
dxDrawRectangle( x - xoff, y + yoff, xoff, h, color, postGUI )
184+
end
185+
end
186+
187+
function dxDrawRectangleCr( posX, posY, width, height, radius, color, postGUI )
188+
local posX, posY, width, height = round( posX ), round( posY ), round( width ), round( height )
189+
local radius = radius and math.min( radius, math.min( width, height ) / 2 ) or 12
190+
191+
dxDrawRectangle( posX, posY + radius, width, height - radius * 2, color, postGUI )
192+
dxDrawRectangle( posX + radius, posY, width - 2 * radius, radius, color, postGUI )
193+
dxDrawRectangle( posX + radius, posY + height - radius, width - 2 * radius, radius, color, postGUI )
194+
195+
dxDrawCorner( posX + radius, posY + radius, radius, color, 1, postGUI )
196+
dxDrawCorner( posX + radius, posY + height - radius, radius, color, 2, postGUI )
197+
dxDrawCorner( posX + width - radius, posY + radius, radius, color, 3, postGUI )
198+
dxDrawCorner( posX + width - radius, posY + height - radius, radius, color, 4, postGUI )
199+
end

‎SRespawnWastedUser.lua

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
function findClosest(ply)
2+
local x,y,z = getElementPosition(ply)
3+
local i = 1
4+
for k,v in pairs(SmerTpositions) do
5+
local dist = getDistanceBetweenPoints3D( x,y,z,v[1],v[2],v[3] )
6+
if dist <= getDistanceBetweenPoints3D( x,y,z,SmerTpositions[i][1],SmerTpositions[i][2],SmerTpositions[i][3] ) then
7+
i = k
8+
end
9+
end
10+
return SmerTpositions[i]
11+
end
12+
13+
14+
15+
function spawnPlayerAtHospital(user)
16+
source = user
17+
local oldskin = getElementModel(source)
18+
local pos = findClosest(source)
19+
20+
setTimer(function(ply,skin,pos)
21+
spawnPlayer( ply, pos[1],pos[2],pos[3],pos[4],skin)
22+
fadeCamera(ply, true,5)
23+
24+
25+
setElementHealth(ply,20)
26+
outputChatBox("Вас успешно реанимировали,ожидайте врача",ply, 89,125,163,true)
27+
28+
end,5000,1,source,oldskin,pos)
29+
end
30+
addEvent('spawnUserHeal',true)
31+
addEventHandler('spawnUserHeal',root,spawnPlayerAtHospital)
32+

‎Shared.lua

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
mob = {'103','03'}
2+
mobile = {'(102-','02) или ','(103-','03)'}
3+
4+
FracGlobalNameChat = "ЦГБ Южный"
5+
okRang = 8 -- С какого ранга разрешено писать в общий чат
6+
govMSG = 9
7+
8+
w0 = "Укажите ID"
9+
w1 = "Укажите организацию"
10+
w2 = "Вы не являетесь лидером фракции"
11+
w3 = "Игрок уже состоит в этой фракции"
12+
w4 = "Игрок не состоит в этой фракции"
13+
w5 = "Укажите номер: экстренных служб:"
14+
w6 = "Убедительная просьба авторизироваться/зарегестрировать аккаунт!"
15+
w7 = "В доступе отказано."
16+
17+
zPosMarkHeal = 10 -- опустить маркер относительно позиции игрока примеры (10) == (-10) другой пример (-10) == (+10)
18+
radiusMarkHeal = 20
19+
mTK = 450 --Стоимость лечения
20+
21+
rangs =
22+
{ 'Интерн',
23+
'Фельдшер',
24+
'Врач - участковый',
25+
'Врач - терапевт',
26+
'Врач - хирург',
27+
'Парамедик',
28+
'Старший специалист',
29+
'Зав. отделением',
30+
'Зам. Главного врача',
31+
'Глав. Врач',
32+
'Ст.Главный врач',
33+
}
34+
35+
36+
payTime = 30 -- В минутах
37+
zarplata = {
38+
4500,
39+
6500,
40+
8750,
41+
10000,
42+
14000,
43+
18000,
44+
20000,
45+
24000,
46+
28000,
47+
30000,
48+
38000,
49+
}
50+
51+
SmerTpositions = {
52+
53+
{2625,-494,12},
54+
{2605,-494,12},
55+
{2615,-513,12},
56+
}
57+
58+
-- x,y,z,r
59+
spawnPoint =
60+
{
61+
{2591,-452,20.6,90},
62+
{2591,-450,20.6,90},
63+
}
64+
65+
invalidSkinMedic =
66+
{
67+
274, --Интерн
68+
275, --Фельдшер
69+
276, --Врач - участковый
70+
308, --Врач - терапевт
71+
308, --Врач - хирург
72+
275, --Парамедик
73+
274, --Старший специалист
74+
308, --Заведующий отделением
75+
275, --Заместитель главного врача
76+
274, --Глав. врач
77+
308, --СТ.Главный врач
78+
}
79+
80+
markerJobsH =
81+
{
82+
{2600,-467,12.5},
83+
{2595,-467,12.5}
84+
}
85+
86+
87+
88+
carPoints =
89+
{
90+
91+
}

‎callCl.lua

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
function sykaNah(vizov)
2+
local string = ''
3+
for k, v in ipairs(vizov) do
4+
string = string..v
5+
end
6+
outputChatBox(string,255,0,0)
7+
end
8+
9+
10+
11+
WastedCall = {}
12+
13+
function updaterCall(login,x,y,z)
14+
15+
mark = createMarker(x,y,z-zPosMarkHeal,'cylinder',radiusMarkHeal,255,200,0,90)
16+
17+
18+
19+
callBlip = createBlip( x, y, z, 0, 0, 255,255, 0 )
20+
setElementData(callBlip,'indexMark',login)
21+
setElementData(callBlip,'blip','callHeal')
22+
setBlipSize ( callBlip, 4)
23+
end
24+
addEvent( "updaterCall", true )
25+
addEventHandler( "updaterCall", localPlayer, updaterCall )
26+
27+
28+
29+
30+
function otobrCall(tabloIbanoe,u1)
31+
for i,v in ipairs(tabloIbanoe) do
32+
callBlip = createBlip( v[2], v[3], v[4], 0, 0, 255,255, 0 )
33+
setElementData(callBlip,'indexMark',v[1])
34+
setElementData(callBlip,'blip','callHeal')
35+
setBlipSize ( callBlip, 4)
36+
end
37+
end
38+
addEvent( "otobrCall", true )
39+
addEventHandler( "otobrCall", localPlayer, otobrCall )
40+
41+
42+
43+
44+
function destroyQuit(login)
45+
for blID,bb in ipairs(getElementsByType ( "blip" )) do
46+
if (getElementData(bb,'indexMark') or nil ) == login then
47+
destroyElement(bb)
48+
end
49+
if isElement(mark) then
50+
destroyElement(mark)
51+
end
52+
end
53+
end
54+
addEvent( "hhuk", true )
55+
addEventHandler( "hhuk", localPlayer, destroyQuit )
56+
57+
58+
function destroyAll()
59+
for blID,bb in ipairs(getElementsByType ( "blip" )) do
60+
if (getElementData(bb,'blip')) == "callHeal" then
61+
destroyElement(bb)
62+
end
63+
end
64+
end
65+
addEvent( "dAlll", true )
66+
addEventHandler( "dAlll", localPlayer, destroyAll )
67+
68+
69+
70+
71+
setTimer ( function()
72+
for blID,BlVal in ipairs(getElementsByType ( "blip" )) do
73+
local red, green, blue, alpha = getBlipColor ( BlVal )
74+
if getElementData(BlVal,'blip') == "callHeal" then
75+
if ( green == 255 ) then
76+
setBlipColor ( BlVal, 255, 0, 0, 255 )
77+
elseif (green == 0) then
78+
setBlipColor ( BlVal, 255,255, 0, 255 )
79+
end
80+
end
81+
end
82+
end, 1000,0)
83+

‎callServ.lua

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
function syka(users)
2+
local string = ''
3+
for k, v in ipairs(mobile) do
4+
string = string..v
5+
end
6+
outputChatBox('Используйте номера экстренных служб: '..string,users,255,0,0)
7+
end
8+
9+
baza = {}
10+
11+
function getUserFormsNick(theCurrentAccount)
12+
for k, player in ipairs ( getElementsByType ( "player" ) ) do
13+
local p_id = getAccountName(getPlayerAccount ( player ))
14+
if ( p_id == getAccountName(theCurrentAccount) ) then
15+
player_n = getAccountName (getPlayerAccount( player ) )
16+
return player, player_n
17+
end
18+
end
19+
return false
20+
end
21+
22+
addEventHandler("onResourceStart",resourceRoot, --Создание таблицы и столбцов
23+
function()
24+
if conn then
25+
local tabela = dbExec(conn,"CREATE TABLE IF NOT EXISTS callCenter(login TEXT,x INT,y INT,z INT)")
26+
else
27+
return
28+
end
29+
end)
30+
31+
addEventHandler("onPlayerQuit", root,
32+
function ()
33+
local login = getAccountName ( getPlayerAccount ( source ) )
34+
triggerClientEvent ( source, "hhuk",source,login)
35+
36+
end)
37+
38+
function loggedOut(thePreviousAccount,theCurrentAccount)
39+
-- outputChatBox( "Вы успешно вышли. Вас звать "..getPlayerName(source), source )
40+
-- local login = getAccountName(thePreviousAccount)
41+
triggerClientEvent (source,"dAlll",source)
42+
end
43+
addEventHandler("onPlayerLogout",getRootElement(),loggedOut)
44+
45+
addEventHandler("onResourceStart",resourceRoot, --Создание таблицы и столбцов
46+
function()
47+
-- table.insert(baza,{'LLIEPLLIEHb2',2590,-454,21})
48+
end
49+
)
50+
51+
function trigaHzNexochetPabotat(u1)
52+
triggerClientEvent (u1,"otobrCall",u1,baza,u1)
53+
end
54+
55+
addEventHandler("onPlayerLogin",root,
56+
function(_, theCurrentAccount)
57+
local accNames = getAccountName(theCurrentAccount)
58+
if isObjectInACLGroup ("user."..accNames, aclGetGroup ( "Heal" ) ) then
59+
-----------------------Отправляем-данные-вызовов-игрокам-фраккции--------------------
60+
local u1,u2 = getUserFormsNick(theCurrentAccount)
61+
trigaHzNexochetPabotat(u1)
62+
-------------------------------------------------------------------------------------
63+
end
64+
end
65+
)
66+
67+
function obtabotka(user)
68+
local login = getAccountName (getPlayerAccount(user))
69+
local x,y,z = getElementPosition(user)
70+
for i,v in ipairs(baza) do
71+
if v[1] == login then
72+
outputChatBox("Вы уже вызвали скорую, ожидайте медика",user,255,255,0) return end
73+
end
74+
mark = createMarker(x,y,z-zPosMarkHeal,'cylinder',radiusMarkHeal,0,200,0,100)
75+
warnmsg(ThePlayer,"Старайтесь не покидать зону вызова,иначе вызов будет отменён")
76+
addEventHandler("onMarkerLeave",mark,
77+
function ( leaveElement, matchingDimension )
78+
if getElementType( leaveElement ) == "player" then
79+
local log = getAccountName (getPlayerAccount(leaveElement))
80+
local user = getPlayerFromLog(log)
81+
82+
triggerClientEvent ( user, "hhuk",user,log)
83+
if isElement(mark) then
84+
destroyElement(mark)
85+
end
86+
outputChatBox ( "Вы покинули зону вызова, вызов скорой помощи отменён!",user, 255, 255, 0 )
87+
local login = getAccountName (getPlayerAccount(user))
88+
for i,v in ipairs(baza) do
89+
if v[1] == login then
90+
table.remove(baza,i)
91+
end
92+
end
93+
end
94+
end)
95+
outputChatBox(''..math.ceil(x)..','..math.ceil(y)..','..math.ceil(z)..'')
96+
table.insert(baza,{login,math.ceil(x),math.ceil(y),math.ceil(z)})
97+
triggerClientEvent ( user, "updaterCall",user,login,math.ceil(x),math.ceil(y),math.ceil(z))
98+
end
99+
100+
addEvent( "obtabotka", true )
101+
addEventHandler( "obtabotka", resourceRoot, obtabotka )
102+
103+
104+
function delCallUserHeal()
105+
local login = getAccountName (getPlayerAccount(source))
106+
for i,v in ipairs(baza) do
107+
if v[1] == login then
108+
table.remove(baza,i)
109+
end
110+
end
111+
end
112+
addEventHandler ( "onPlayerQuit", root, delCallUserHeal )
113+
114+
function callPlayer(ThePlayer,cmd,obr)
115+
if isGuestAccount ( getPlayerAccount ( ThePlayer ) ) then
116+
warnmsg(ThePlayer,w6)
117+
warnmsg(ThePlayer,w7) return end
118+
119+
if obr == nil or obr == '' or obr == ' ' then syka(ThePlayer) return end
120+
if obr == mob[1] or obr == mob[2] then
121+
122+
obtabotka(ThePlayer)
123+
else
124+
syka(ThePlayer) return end
125+
--------------------
126+
end
127+
addCommandHandler('call',callPlayer)
128+
129+
130+
131+
132+
133+
134+
135+
------------------------------------------------------------------------------------
136+
-- local theTikGap = 7.5
137+
-- local getLastTick = getTickCount()
138+
139+
-- function obrCall()
140+
-- if (getTickCount ( ) - getLastTick < theTikGap*1000) then
141+
-- -- outputChatBox('Не флуди подожи: '..theTikGap..' sec.',255,0,0)
142+
-- return
143+
-- end
144+
-- triggerServerEvent ( "spawnUserHeal", resourceRoot, getLocalPlayer() )
145+
-- -- outputChatBox("Функция")
146+
-- getLastTick = getTickCount()
147+
-- end
148+
149+
150+
-- function quitPlayer ( quitType )
151+
-- triggerClientEvent ( source, "qutSHeal",source,source)
152+
-- end

‎chatFrac.lua

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
function rpCharLocFrac(ThePlayer, cmd, ...)
2+
local playerlist = getElementsByType("player")
3+
local acc = getPlayerAccount(ThePlayer)
4+
local accName = getAccountName(acc)
5+
local acl = aclGetGroup ("Heal" )
6+
if isObjectInACLGroup ("user."..accName, acl) then
7+
for k, v in ipairs(playerlist) do
8+
local arg = {...}
9+
local text = table.concat( arg, " " )
10+
local account = getPlayerAccount(v)
11+
local accountName = getAccountName(account)
12+
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "Heal" ) ) then
13+
if ... then
14+
local policeRank = 'Питух'
15+
local idrang = getRang(ThePlayer)
16+
for i,v in ipairs(rangs) do
17+
if i == idrang then
18+
rang =v
19+
end
20+
end
21+
outputChatBox("#ff0000["..rang.."] "..getPlayerName(ThePlayer).."["..getElementData(ThePlayer,"ID").."]: "..text, v, 65, 105, 225,true)
22+
end
23+
end
24+
end
25+
end
26+
end
27+
addCommandHandler("r", rpCharLocFrac)
28+
29+
function nrpCharLocFrac(ThePlayer, cmd, ...)
30+
local playerlist = getElementsByType("player")
31+
local acc = getPlayerAccount(ThePlayer)
32+
local accName = getAccountName(acc)
33+
local acl = aclGetGroup ("Heal" )
34+
if isObjectInACLGroup ("user."..accName, acl) then
35+
for k, v in ipairs(playerlist) do
36+
local arg = {...}
37+
local text = table.concat( arg, " " )
38+
local account = getPlayerAccount(v)
39+
local accountName = getAccountName(account)
40+
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "Heal" ) ) then
41+
if ... then
42+
local idrang = getRang(ThePlayer)
43+
for i,v in ipairs(rangs) do
44+
if i == idrang then
45+
rang =v
46+
end
47+
end
48+
outputChatBox("#ff0000(( NRP CHAT - ["..rang.."] "..getPlayerName(ThePlayer).."["..getElementData(ThePlayer,"ID").."]:#f5f5dc "..text.."#ff0000 ))", v, 65, 105, 225,true)
49+
end
50+
end
51+
end
52+
end
53+
end
54+
addCommandHandler("rb", nrpCharLocFrac)
55+
56+
57+
58+
function ceGovkaFrac(ThePlayer,cmd,...)
59+
local account = getPlayerAccount(ThePlayer)
60+
local accountName = getAccountName(account)
61+
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "Heal" ) ) then
62+
local arg = {...}
63+
local text = table.concat( arg, " " )
64+
if ... then
65+
local idrang = getRang(ThePlayer)
66+
if idrang <= 8 then
67+
warnmsg(ThePlayer,'Вам запрещено сюда писать (с '..govMSG..' ранга)') return end
68+
outputChatBox ("#00bfff[Новости "..FracGlobalNameChat.."] "..getPlayerName(ThePlayer).."["..getElementData(ThePlayer,"ID").."]:#00bfff "..text, root, 200, 0, 0, true)
69+
end
70+
end
71+
end
72+
addCommandHandler("gov",ceGovkaFrac)
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+
-- function printMsgOuSheet(msg)
84+
-- for i,v in ipairs(getElementsByType("player")) do
85+
-- if getElementData(v,"frac") then
86+
-- outputChatBox(msg,v,65, 105, 225,true)
87+
-- end
88+
89+
-- end
90+
91+
92+
93+
94+
function obChat(ThePlayer, cmd, ...)
95+
local playerlist = getElementsByType("player")
96+
local acc = getPlayerAccount(ThePlayer)
97+
local accName = getAccountName(acc)
98+
local acl = aclGetGroup ("Heal" )
99+
if isObjectInACLGroup ("user."..accName, acl) then
100+
for k, v in ipairs(playerlist) do
101+
local arg = {...}
102+
local text = table.concat( arg, " " )
103+
local account = getPlayerAccount(v)
104+
local accountName = getAccountName(account)
105+
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "Heal" ) ) then
106+
if ... then
107+
108+
local idrang = getRang(ThePlayer)
109+
for i,v in ipairs(rangs) do
110+
if i == idrang then
111+
rang =v
112+
end
113+
end
114+
115+
if idrang <= 7 then
116+
warnmsg(ThePlayer,'Вам запрещено сюда писать (с '..okRang..' ранга)') return end
117+
118+
printMsgOuSheet("#ff0000[ Общий чат ["..FracGlobalNameChat.."] ["..rang.."] "..getPlayerName(ThePlayer).."["..getElementData(ThePlayer,"ID").."]: "..text.." ]")
119+
120+
end
121+
end
122+
end
123+
end
124+
end
125+
addCommandHandler("ob", obChat)
126+
127+

‎font.ttf

45.9 KB
Binary file not shown.

‎interface.lua

+329
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,329 @@
1+
local x, y = guiGetScreenSize()
2+
m1 = 500
3+
m2 = 240
4+
Lbase = {}
5+
6+
function findWindow(unpackData)
7+
8+
showCursor(true)
9+
windowFindH = guiCreateWindow(x/2-(m1/2),y/2-(m2/2),m1,m2, "Список игроков фракции", false)
10+
GridHeals = guiCreateGridList(10, 29, 490, 160, false, windowFindH)
11+
guiGridListAddColumn(GridHeals, " ID", 0.1)
12+
guiGridListAddColumn(GridHeals, "Имя", 0.275)
13+
guiGridListAddColumn(GridHeals, "Должность", 0.25)
14+
guiGridListAddColumn(GridHeals, "Смена", 0.16)
15+
guiGridListAddColumn(GridHeals, "Статус", 0.15)
16+
guiGridListClear(GridHeals)
17+
HealCloseButton = guiCreateButton(10, 210, 490, 22, "Закрыть", false, windowFindH)
18+
19+
20+
-- ◊ ◈ □ ■ ▪ ▫
21+
22+
for key, value in pairs( unpackData ) do
23+
table.insert(Lbase, {value[key]})
24+
local row = guiGridListAddRow(GridHeals)
25+
guiGridListSetItemText(GridHeals, row, 2,' '..value[2], false, false)
26+
for i,v in ipairs(rangs) do
27+
if i == value[4] then
28+
guiGridListSetItemText(GridHeals, row, 3,' ['..v..']', false, false)
29+
end
30+
if not value[3] == false then
31+
local dat1 = getElementData(value[3],"ID") or "-"
32+
guiGridListSetItemText(GridHeals, row, 1,'('..dat1..')', false, false)
33+
else
34+
guiGridListSetItemText(GridHeals, row, 1,' -', false, false)
35+
end
36+
if not value[3] == false then
37+
local dat2 = getElementData(value[3],"smena-Heal") or "error"
38+
if dat2 == "сдал" then
39+
guiGridListSetItemText(GridHeals, row,4,' '..dat2, false, false)
40+
guiGridListSetItemColor ( GridHeals, row, 4, 255,0,0 )
41+
42+
elseif dat2 == "работает" then
43+
guiGridListSetItemText(GridHeals, row,4,' '..dat2, false, false)
44+
guiGridListSetItemColor ( GridHeals, row, 4, 0,255,0 )
45+
end
46+
end
47+
if not value[3] == false then
48+
guiGridListSetItemText(GridHeals, row, 5,' online', false, false)
49+
guiGridListSetItemColor ( GridHeals, row, 5, 0,255,0 )
50+
else
51+
guiGridListSetItemText(GridHeals, row,4," сдал", false, false)
52+
guiGridListSetItemColor ( GridHeals, row, 4, 255,0,0 )
53+
guiGridListSetItemText(GridHeals, row, 5,' offline', false, false)
54+
guiGridListSetItemColor ( GridHeals, row, 5, 150,150,150 )
55+
end
56+
end
57+
end
58+
59+
60+
-- 1 логин игрока
61+
-- 2 Никнейм
62+
-- 3 Указатель на игрока
63+
-- 4 Ранг
64+
-- 5 состояние работы (не отпровляем т.к лучше искать на клиенте)
65+
---------------------------------------------------------------------------------------------
66+
guiWindowSetSizable(windowFindH, false)
67+
guiSetFont(HealCloseButton, "default-bold-small")
68+
guiSetProperty(HealCloseButton, "NormalTextColour", "FFFF0000")
69+
end
70+
71+
function opWindows(unpackData)
72+
if isElement(windowFindH) then
73+
else
74+
findWindow(unpackData)
75+
end
76+
end
77+
addEvent( "windowFindH", true )
78+
addEventHandler( "windowFindH", localPlayer, opWindows )
79+
80+
function closeFind(button,state)
81+
if button == "left" and state == "up" then
82+
if source == HealCloseButton then
83+
destroyElement(windowFindH)
84+
showCursor(false)
85+
end
86+
end
87+
end
88+
addEventHandler("onClientGUIClick",resourceRoot,closeFind)
89+
90+
--------------------------------------------------------------------------------------------
91+
--------------------------------------------------------------------------------------------
92+
--------------------------------------------------------------------------------------------
93+
--------------------------------------------------------------------------------------------
94+
m3 = 350
95+
m4 = 125
96+
statka = false
97+
function jobmedic(hitPlayer)
98+
if hitPlayer == getLocalPlayer() then return end
99+
if statka == false then
100+
statka = true
101+
showCursor(true)
102+
main = guiCreateWindow(x/2-(m3/2),y/2-(m4/2),m3,m4, "Выберите действие", false)
103+
104+
if getElementData(getLocalPlayer(),'smena-Heal') == "сдал" then
105+
btns = guiCreateButton(10, 90, 130, 25, "Заступить на смену", false, main)
106+
guiSetFont(btns, "default-bold-small")
107+
guiSetProperty(btns, "NormalTextColour", "FF00defd")
108+
109+
110+
elseif getElementData(getLocalPlayer(),'smena-Heal') == "работает" then
111+
btns = guiCreateButton(10, 90, 130, 25, "Закончить на смену", false, main)
112+
guiSetFont(btns, "default-bold-small")
113+
guiSetProperty(btns, "NormalTextColour", "FFaf7c00")
114+
end
115+
116+
117+
close = guiCreateButton(210, 90, 130, 25, "Закрыть", false, main)
118+
guiWindowSetSizable(main, false)
119+
guiSetFont(close, "default-bold-small")
120+
guiSetProperty(close, "NormalTextColour", "FFFF0000")
121+
end
122+
end
123+
addEvent( "okeyJob", true )
124+
addEventHandler( "okeyJob", localPlayer, jobmedic )
125+
126+
function cls()
127+
if isElement(main) then
128+
destroyElement(main)
129+
statka = false
130+
showCursor(false)
131+
end
132+
end
133+
134+
135+
function getJobState(user)
136+
local data = getElementData(getLocalPlayer(),'smena-Heal') or nil
137+
if data == 'сдал' then
138+
return false
139+
elseif data == 'работает' then
140+
return true
141+
end
142+
end
143+
144+
function closeFind(button,state)
145+
if button == "left" and state == "up" then
146+
if source == btns then
147+
cls()
148+
if getJobState() == false then
149+
triggerServerEvent ( "goJob", resourceRoot, getLocalPlayer() )
150+
elseif getJobState() == true then
151+
triggerServerEvent ( "stopJob", resourceRoot, getLocalPlayer() )
152+
end
153+
elseif source == close then
154+
cls()
155+
end
156+
end
157+
end
158+
addEventHandler("onClientGUIClick",resourceRoot,closeFind)
159+
160+
161+
-- function Renderds()
162+
-- local data = getElementData(getLocalPlayer(),'smena-Heal') or 0
163+
-- dxDrawText (data, x/2,y/2,x/2,y/2, tocolor(255,255,255),1, f.text,"center" )
164+
-- end
165+
166+
-- addEventHandler ( "onClientRender", root,Renderds)
167+
168+
--------------------------------------------------------------------------------------------
169+
--------------------------------------------------------------------------------------------
170+
--------------------------------------------------------------------------------------------
171+
--------------------------------------------------------------------------------------------
172+
173+
myFont = guiCreateFont( "font.ttf", 10.5)
174+
175+
function createAcceptWindowMeDICK(userId,message,ThePlayer)
176+
if not userId == getLocalPlayer() then return end
177+
178+
winn = guiCreateWindow((x - 407) / 2, (y - 159) / 2, 407, 159, "Оплата медикоментов.", false)
179+
guiSetProperty(winn, "CaptionColour", "FFEC5412")
180+
guiWindowSetSizable(winn, false)
181+
182+
183+
clOplata = guiCreateButton(255, 109, 120, 33, "Отменить", false, winn)
184+
guiSetProperty(clOplata, "NormalTextColour", "FFED1010")
185+
okOplata = guiCreateButton(35, 109, 120, 33, "Оплатить", false, winn)
186+
guiSetProperty(okOplata, "NormalTextColour", "FF2CE01E")
187+
188+
labels = guiCreateLabel(38, 36, 330, 63, "Игрок "..ThePlayer..", предлагает вам \n \""..message.."\",\n за "..mTK.." рублей.", false, winn)
189+
guiSetFont(labels, myFont)
190+
guiSetFont(clOplata, myFont)
191+
guiSetFont(okOplata, myFont)
192+
guiLabelSetHorizontalAlign(labels, "center", false)
193+
guiLabelSetVerticalAlign(labels, "center")
194+
195+
guiSetInputMode("no_binds")
196+
197+
198+
end
199+
200+
201+
202+
203+
204+
function Opppa1(userId,message,ThePlayer)
205+
if not isElement(winn) then
206+
showCursor(true)
207+
createAcceptWindowMeDICK(userId,message,ThePlayer)
208+
end
209+
end
210+
211+
212+
addEvent( "MsgWinHeal", true )
213+
addEventHandler( "MsgWinHeal", localPlayer, Opppa1 )
214+
215+
216+
function fnClose()
217+
if isElement(winn) then
218+
destroyElement(winn)
219+
end
220+
guiSetInputMode("allow_binds")
221+
showCursor(false)
222+
end
223+
224+
225+
function clickOff(button,state) -- Скрытие окна
226+
if button == "left" and state == "up" then
227+
if source == clOplata then
228+
fnClose()
229+
elseif source == okOplata then
230+
fnClose()
231+
local mybabki = getPlayerMoney ()
232+
if (mybabki >= mTK) then
233+
triggerServerEvent ( "healPedik", resourceRoot,getLocalPlayer())
234+
else
235+
outputChatBox("У вас не хватает денег",255,0,0)
236+
end
237+
end
238+
end
239+
end
240+
241+
addEventHandler("onClientGUIClick",resourceRoot,clickOff)
242+
243+
--------------------------------------------------------------------------------------------
244+
--------------------------------------------------------------------------------------------
245+
--------------------------------------------------------------------------------------------
246+
local px = x/x
247+
fonts = {
248+
text = guiCreateFont("font.ttf", 8*px, false, "antialiased"),
249+
250+
}
251+
252+
253+
254+
function pipUser(user,AttUser)
255+
if user then
256+
pipPlayer = user
257+
else
258+
user = nil
259+
end
260+
261+
if AttUser then
262+
ThePlayer = AttUser
263+
end
264+
invites()
265+
end
266+
addEvent( "pipUser", true )
267+
addEventHandler( "pipUser", localPlayer, pipUser )
268+
-- pipUser()
269+
270+
271+
272+
273+
274+
function invites()
275+
-- showCursor(true)
276+
winAccepts = guiCreateWindow((x - 350) / 2, (y - 110) / 2, 350, 110, "Вступить в фракцию "..FracGlobalNameChat.."?", false)
277+
guiSetProperty(winAccepts, "CaptionColour", "FF2CE01E")
278+
guiWindowSetSizable(winAccepts, false)
279+
280+
aFrac = guiCreateButton(0, 75, 120, 30, "Вступить", false, winAccepts)
281+
guiSetProperty(aFrac, "NormalTextColour", "FF2CE01E")
282+
nFrac = guiCreateButton(215, 75, 120, 30, "Отказаться", false, winAccepts)
283+
guiSetProperty(nFrac, "NormalTextColour", "FFED1010")
284+
285+
286+
guiSetFont(aFrac, fonts.text)
287+
guiSetFont(nFrac, fonts.text)
288+
289+
290+
guiSetInputMode("no_binds")
291+
end
292+
-- invites()
293+
294+
295+
296+
function Adest()
297+
if isElement(winAccepts) then
298+
destroyElement(winAccepts)
299+
end
300+
local currentState = isCursorShowing ()
301+
local oppositeState = currentState
302+
guiSetInputMode("allow_binds")
303+
showCursor ( oppositeState )
304+
end
305+
306+
307+
function iClick(button,state)
308+
if button == "left" and state == "up" then
309+
if source == aFrac then
310+
--------------
311+
if ThePlayer then
312+
if pipPlayer == nil then return end
313+
local tostr = getElementData(getLocalPlayer(),"ID") or nil
314+
if not tostr == nil then return end
315+
316+
local encodedString = teaEncode(tostr, 14882020666777 )
317+
triggerServerEvent ( "hachukaPizza", resourceRoot, encodedString,ThePlayer)
318+
Adest()
319+
-----------------------------------------------------------------
320+
else if source == nFrac then
321+
-----------------------------------------------------------------
322+
Adest()
323+
--------------
324+
end
325+
end
326+
end
327+
end
328+
end
329+
addEventHandler("onClientGUIClick",resourceRoot,iClick)

‎markerjob.lua

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
local x,y = guiGetScreenSize()
2+
local px = x/x
3+
fonts = {
4+
text = dxCreateFont("font.ttf", 10*px, false, "antialiased"),
5+
6+
}
7+
8+
9+
10+
11+
function Render()
12+
13+
for k,v in ipairs(markerJobsH) do
14+
local x,y,z = v[1],v[2],v[3]-0.5
15+
local x1,y1,z1 = v[1],v[2],v[3]-0.75
16+
local Mx, My, Mz = getCameraMatrix()
17+
local px,py,pz = getElementPosition(getLocalPlayer())
18+
local distance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz )
19+
if ( getDistanceBetweenPoints3D ( x,y,z, getElementPosition ( localPlayer ) ) ) < 20 then
20+
local coords = { getScreenFromWorldPosition ( x,y,z+1 ) }
21+
if coords[1] and coords[2] then
22+
if processLineOfSight(x1,y1,z1, Mx, My, Mz, true, false, false, true, false, true) then break end
23+
dxDrawText ( "Раздевалка", coords[1], coords[2], coords[1], coords[2], tocolor(255,255,255), math.min ( 0.4*(15/distance)/1.4,1), fonts.text,"center" )
24+
end
25+
end
26+
end
27+
end
28+
addEventHandler ("onClientRender",root,Render)
29+
30+
31+
32+
bindKey ("f2", "down", function()
33+
if not isEventHandlerAdded( 'onClientRender', root, Render) then
34+
outputChatBox("Нет рендера")
35+
end
36+
end)
37+
38+
39+
40+
function destMarkh(user)
41+
if not user == getLocalPlayer() then return end
42+
43+
if isElement(myMarkerH) then
44+
removeEventHandler('onClientRender',root,Render)
45+
end
46+
47+
for i, mark in ipairs ( getElementsByType ( "marker" ) ) do
48+
if (getElementData(mark,'marker-Healssss') == true) then
49+
destroyElement(mark)
50+
end
51+
end
52+
end
53+
addEvent( "destMarkh", true )
54+
addEventHandler( "destMarkh", localPlayer, destMarkh )

‎meta.xml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<meta>
2+
<file src="font.ttf" cache = "false" />
3+
<script src="Shared.lua" type="shared"/>
4+
<script src="interface.lua" type="client" compile="1"/>
5+
<script src="server.lua" type="server"/>
6+
<script src="markerJob.lua" type="client" />
7+
<script src="spawnManager.lua" type="server" />
8+
9+
10+
<script src="callServ.lua" type="server" />
11+
<script src="callCl.lua" type="client" />
12+
13+
<script src="CRespawnWastedUser.lua" type="client" />
14+
<script src="SRespawnWastedUser.lua" type="server" />
15+
16+
<script src="chatFrac.lua" type="server" />
17+
<script src="payDay.lua" type="server" />
18+
<oop>true</oop>
19+
</meta>

‎payDay.lua

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
function payDay()
2+
local playerlist = getElementsByType("player")
3+
for k, player in ipairs(playerlist) do
4+
local idrang = getRang(player)
5+
for i,v in ipairs(zarplata) do
6+
if idrang == i then
7+
zp = tonumber(v)
8+
outputChatBox("Вы получили зарплату: "..zp.."р ",player,255,255,15)
9+
end
10+
end
11+
end
12+
end
13+
setTimer(payDay,payTime*60000,0)
14+
15+
16+
nTime = payTime
17+
function payTime()
18+
nTime = nTime-1
19+
if nTime == 0 then
20+
nTime = payTime
21+
end
22+
end
23+
setTimer(payTime,60000,0)
24+
25+
26+
27+
function ppAy(thePlayer)
28+
outputChatBox("До зарплаты осталось "..nTime.." минут.", thePlayer, 255, 255, 0)
29+
end
30+
addCommandHandler("paytime", ppAy)
31+
32+

‎server.lua

+439
Large diffs are not rendered by default.

‎spawnManager.lua

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
function getRang(user)
2+
if user == nil or user == '' then return false end
3+
local login = getAccountName(getPlayerAccount(user))
4+
if isObjectInACLGroup ("user."..login, aclGetGroup ( "Heal" ) ) then
5+
local q = dbQuery(conn, "SELECT * FROM CGB WHERE login=?",login)
6+
local result = dbPoll(q,-1)
7+
if result then
8+
for _,row in ipairs(result) do
9+
if row["rang"] then
10+
return tonumber(row["rang"])
11+
end
12+
end
13+
end
14+
end
15+
return false
16+
end
17+
18+
function getSkinSpawn()
19+
local rang = getRang(source)
20+
for i,v in ipairs(invalidSkinMedic) do
21+
if i == rang then
22+
return v
23+
end
24+
end
25+
return 0
26+
end
27+
28+
29+
function spawnUser()
30+
local login = getAccountName(getPlayerAccount(source))
31+
if isObjectInACLGroup ("user."..login, aclGetGroup ( "Heal" ) ) then
32+
local x,y,z,r = unpack(spawnPoint[math.random(1,#spawnPoint)])
33+
spawnPlayer(source,x+math.random(-0.5,0.5),y+math.random(-0.5,0.5),z,r,getSkinSpawn(),0,0)
34+
fadeCamera(source, true)
35+
setCameraTarget(source, source)
36+
end
37+
end
38+
addEventHandler("onPlayerLogin",root,spawnUser)

0 commit comments

Comments
 (0)
Please sign in to comment.