· 7 years ago · Feb 01, 2019, 08:04 PM
1--â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•—â•”â•╗╔╗───╔â•â•â•—â•”â•â•â•â•â•—â•”â•â•â•â•—
2--â•‘â•”â•â•—â•‘â•‘â•”â•â•—â•‘â•‘â•”â•â•â•╚╗╚â•â•”â•║║───╚╣─â•║╔╗╔╗║║╔â•â•â•
3--║║─╚â•║╚â•â•║║╚â•â•╗─╚╗╔â•─║║────║║─╚â•║║╚â•║╚â•â•â•—
4--║║─╔╗║╔╗╔â•â•‘â•”â•â•â•─╔â•╚╗─║║─╔╗─║║───║║──║╔â•â•â•
5--║╚â•â•║║║║╚╗║╚â•â•â•—â•”â•╔╗╚╗║╚â•â•║╔╣─╗──║║──║╚â•â•â•—
6--╚â•â•â•â•╚â•╚â•â•╚â•â•â•â•╚â•â•╚â•â•╚â•â•â•â•╚â•â•â•──╚â•──╚â•â•â•â•
7
8-- â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•â•â•â•—â•”â•â•â•â•—
9-- â•‘â•”â•â•—â•‘â•‘â•”â•╗║║╔╗╔╗║║╔â•â•—â•‘
10-- ║╚â•â•║║║─║║╚â•║║╚â•║║─║║
11-- â•‘â•”â•â•â•║╚â•â•║──║║──║║─║║
12-- ║║───║╔â•╗║──║║──║╚â•â•â•‘
13-- ╚â•───╚â•─╚â•──╚â•──╚â•â•â•â•
14
15
16-- â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•â•â•—â•”â•â•—â•”â•â•—â•”â•â•—â•”â•â•—
17-- â•‘â•”â•â•—â•‘â•‘â•”â•â•—â•‘â•‘â•”â•â•—â•‘â•‘â•”â•╗║╚╗╔╗║║╔â•╗║╚╗╚â•â•”â•╚╗╚â•â•”â•
18-- ║╚â•â•║║║─║║║╚â•â•║║║─║║─║║║║║║─║║─╚╗╔â•──╚╗╔â•─
19-- â•‘â•”â•â•â•║╚â•â•║║╔╗╔â•║╚â•â•║─║║║║║║─║║─╔â•╚╗──╔â•╚╗─
20-- ║║───║╔â•╗║║║║╚╗║╔â•â•—â•‘â•”â•╚â•║║╚â•â•â•‘â•”â•╔╗╚╗╔â•╔╗╚╗
21-- ╚â•───╚â•─╚â•╚â•╚â•â•╚â•─╚â•╚â•â•â•â•╚â•â•â•â•╚â•â•╚â•â•╚â•â•╚â•â•
22
23
24
25local mysql = exports.mysql
26
27------------------------------------------------------------------------------------------------------------------------------
28
29-- CHOROBY, A ICH FUNKCIE
30
31------------------------------------------------------------------------------------------------------------------------------
32
33local nemoce = {
34
35 -- Å Ãrenie:
36 -- 0 - Žiadne
37 -- 1 - Dotykom
38 -- 2 - Dychom
39 -- Zrušenie:
40 -- 0 - Žiadne
41 -- 1 - Lieky
42 -- 2 - ÄŒasom
43 -- 3 - Dlhodobá lieÄba
44 -- Obraz:
45 -- 0 - Žiadne
46 -- 1 - Krvavý
47 -- 2 - Trochu rozmazaný
48 -- 3 - Krvavá obrazovka
49 -- HP:
50 -- 0 - Neuberá HP
51 -- 1 - Uberá po 5 HP
52 -- Kašeľ:
53 -- 0 - Žiadny
54 -- 1 - Jemný kašeľ
55 -- 2 - Dlhšà kašeľ
56 -- 3 - Zvracanie
57
58 -- Názov Å Ãrenie ZruÅ¡enie HP Obraz KaÅ¡eľ Dehydratovanie - ( NENASTAVOVAT, NEFUNGUJE )
59
60 ["Chřipka"] = { 2, 2, 0, 0, 1, 0 },
61
62 ["Rýma"] = { 0, 1, 0, 0, 1, 0 },
63
64 ["Modezia"] = { 1, 0, 1, 1, 2, 0 },
65
66 ["Tulerin"] = { 2, 3, 1, 3, 3, 0 },
67
68 ["Zápal plic"] = { 2, 1, 0, 0, 1, 0 },
69
70 ["Rakovina"] = { 0, 0, 1, 0, 0, 0 },
71}
72
73------------------------------------------------------------------------------------------------------------------------------
74
75-- KONTROLA CHOROB, + TIMER NA KAŠEĽ / RIADOK 64
76
77------------------------------------------------------------------------------------------------------------------------------
78
79function kontrolanemoci()
80 local query = mysql:query("SELECT * FROM nakazeni")
81 while true do
82 local row = mysql:fetch_assoc(query)
83 if not row then return end
84
85 local player = getPlayerFromName(row["postava"])
86 if(player)then
87 if(getElementData(player, "loggedin") == 1)then
88 if(nemoce[row["nemoc"]])then
89 exports['anticheat']:changeProtectedElementDataEx(player, "nemoc", row["nemoc"])
90 if(math.random(1,5)==3)then
91 setTimer(symptomy, math.random(2,5)*50, 1, player, row["nemoc"], row["stadium"])
92 end
93 else
94 mysql:query_free("DELETE FROM nakazeni WHERE id = '"..(mysql:escape_string(row["id"])).."'")
95 end
96 end
97 end
98 end
99end
100setTimer(kontrolanemoci, 60000, 0)
101setTimer(kontrolanemoci, 1000, 1)
102
103function kontrola(player)
104 local query = mysql:query("SELECT nemoc FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(player))).."'")
105 local row = mysql:fetch_assoc(query)
106 if row then
107 exports['anticheat']:changeProtectedElementDataEx(player, "nemoc", row["nemoc"])
108 if(nemoce[row["nemoc"]][4] == 0)then
109 removeElementData(player, "nemoc:obraz")
110 else
111 exports['anticheat']:changeProtectedElementDataEx(player, "nemoc:obraz", nemoce[row["nemoc"]][4])
112 end
113 end
114end
115
116------------------------------------------------------------------------------------------------------------------------------
117
118-- SYMPTOMY
119
120------------------------------------------------------------------------------------------------------------------------------
121
122function symptomy(player, nemoc, stadium)
123 if not player then return end
124
125
126
127------------------------------------------------------------------------------------------------------------------------------
128
129-- KAŠEĽ, PRI CHOROBE
130
131------------------------------------------------------------------------------------------------------------------------------
132
133 local x,y,z = getElementPosition(player)
134 if(nemoce[nemoc][5] == 1)then
135 exports.global:sendLocalMeAction(player, "zakašlal.")
136 for k, v in ipairs(getElementsByType("player"))do
137 local ux,uy,uz = getElementPosition(v)
138 if(getDistanceBetweenPoints3D(x,y,z,ux,uy,uz)<10)then
139 triggerClientEvent(v, "nemoc:zakaslat", player)
140 end
141 end
142 end
143
144-- DRUHY KAŠEĽ
145
146 local x,y,z = getElementPosition(player)
147 if(nemoce[nemoc][5] == 2)then
148 exports.global:sendLocalMeAction(player, "zakašlal.")
149 for k, v in ipairs(getElementsByType("player"))do
150 local ux,uy,uz = getElementPosition(v)
151 if(getDistanceBetweenPoints3D(x,y,z,ux,uy,uz)<10)then
152 triggerClientEvent(v, "nemoc:zakaslat1", player)
153 end
154 end
155 end
156
157-- ZVRACANIE
158
159 local x,y,z = getElementPosition(player)
160 if(nemoce[nemoc][5] == 3)then
161 exports.global:sendLocalMeAction(player, "se vyzvracel.")
162 for k, v in ipairs(getElementsByType("player"))do
163 local ux,uy,uz = getElementPosition(v)
164 if(getDistanceBetweenPoints3D(x,y,z,ux,uy,uz)<10)then
165 triggerClientEvent(v, "nemoc:vyzvracet", player)
166 end
167 end
168 end
169
170------------------------------------------------------------------------------------------------------------------------------
171
172-- ODOBERANIE HP POÄŒAS CHOROBY
173
174------------------------------------------------------------------------------------------------------------------------------
175
176 if(nemoce[nemoc][3] == 1)then
177 if(getElementHealth(player) > 15)then
178 setElementHealth(player, math.max(0, getElementHealth(player)-5))
179 end
180 end
181
182------------------------------------------------------------------------------------------------------------------------------
183
184-- OBRAZ, PRI CHOROBE
185
186------------------------------------------------------------------------------------------------------------------------------
187
188 if(nemoce[nemoc][4] == 0)then
189 removeElementData(player, "nemoc:obraz")
190 else
191 exports['anticheat']:changeProtectedElementDataEx(player, "nemoc:obraz", nemoce[nemoc][4])
192 end
193
194------------------------------------------------------------------------------------------------------------------------------
195
196-- DOPLNOK ( NERIEŠIŤ A NEMENIŤ )
197
198------------------------------------------------------------------------------------------------------------------------------
199
200 truenemoc = nemoc
201 if stadium then
202 nemoc = nemoc.."!"..stadium
203 end
204
205
206------------------------------------------------------------------------------------------------------------------------------
207
208-- Å ÃRENIE A RUÅ ENIE
209-- Å ÃRENIE A RUÅ ENIE
210-- Å ÃRENIE A RUÅ ENIE
211
212------------------------------------------------------------------------------------------------------------------------------
213
214 -- NERIEŠIŤ A NEMENIŤ
215 nemoc = truenemoc
216
217------------------------------------------------------------------------------------------------------------------------------
218
219-- Å ÃRENIE DYCHOM
220
221------------------------------------------------------------------------------------------------------------------------------
222
223 if(nemoce[nemoc][1] == 2)then
224 local x,y,z = getElementPosition(player)
225 local newcolshape = createColSphere(x, y, z-1, 3)
226 local theplayers = getElementsWithinColShape(newcolshape, "player")
227 for k,v in ipairs(theplayers) do
228 local cangohuh = false
229 local cilnemoc = getElementData(v, "nemoc")
230 if(cilnemoc)then
231 if(cilnemoc~=nemoc)then
232 cangohuh = true
233 end
234 else
235 cangohuh = true
236 end
237 -- DOKONČIŤ ÚSTNE RÚŠKO ABY SA ZZS NENAKAZILA
238 if(not(getElementData(v, "gasmask")) and cangohuh and not(v==player))then
239 exports['anticheat']:changeProtectedElementDataEx(v, "nemoc", nemoc)
240 mysql:query_free("UPDATE nakazeni SET nakazil = nakazil + 1 WHERE postava = '"..(mysql:escape_string(getPlayerName(player))).."'")
241 mysql:query_free("INSERT INTO nakazeni (postava,nemoc,stadium) VALUES ('"..(mysql:escape_string(getPlayerName(v))).."','"..(nemoc).."',1)")
242 end
243 end
244 destroyElement(newcolshape)
245 end
246
247------------------------------------------------------------------------------------------------------------------------------
248
249-- ZRUÅ ENIE ÄŒASOM A DLHODOBO
250
251------------------------------------------------------------------------------------------------------------------------------
252
253 if(nemoce[nemoc][2] == 2)then
254 if(math.random(1,30)==15)then
255 removeElementData(player, "nemoc")
256 removeElementData(player, "nemoc:obraz")
257 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(player))).."' AND nemoc = '"..(mysql:escape_string(nemoc)).."'")
258 end
259 elseif(nemoce[nemoc][2] == 3)then
260 if(math.random(1,40)==20 and getElementDimension(player)==93)then
261 removeElementData(player, "nemoc")
262 removeElementData(player, "nemoc:obraz")
263 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(player))).."' AND nemoc = '"..(mysql:escape_string(nemoc)).."'")
264 end
265 end
266end
267
268------------------------------------------------------------------------------------------------------------------------------
269
270-- Å ÃRENIE DOTYKOM
271
272------------------------------------------------------------------------------------------------------------------------------
273function infectsirit(attacker, weapon, bodypart, loss)
274 if(attacker and getElementType(attacker)=="player")then
275 if(weapon<16)then
276 local nemo = getElementData(attacker, "nemoc")
277 if(nemo)then
278 if(nemoce[nemo][1]==1 or nemoce[nemo][1]==2)then
279 if(not(getElementData(source, "nemoc")==nemo))then
280 mysql:query_free("UPDATE nakazeni SET nakazil = nakazil + 1 WHERE postava = '"..(mysql:escape_string(getPlayerName(attacker))).."'")
281 mysql:query_free("INSERT INTO nakazeni (postava,nemoc) VALUES ('"..(mysql:escape_string(getPlayerName(source))).."','"..(mysql:escape_string(nemo)).."')")
282 end
283 end
284 end
285 end
286 end
287end
288addEventHandler("onPlayerDamage", getRootElement(), infectsirit)
289
290------------------------------------------------------------------------------------------------------------------------------
291
292-- VYLIEÄŒENIE
293
294------------------------------------------------------------------------------------------------------------------------------
295
296
297function vylecit(thePlayer, nemoc, forced)
298 if(getElementData(thePlayer, "loggedin") == 1)then
299 if(nemoce[nemoc])then
300 if(nemoce[nemoc][2]==1 or forced)then
301 removeElementData(thePlayer, "nemoc")
302 removeElementData(thePlayer, "nemoc:obraz")
303 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(thePlayer))).."' AND nemoc = '"..(mysql:escape_string(nemoc)).."'")
304 end
305 end
306 end
307end
308
309------------------------------------------------------------------------------------------------------------------------------
310
311-- NAKAZENIE
312
313------------------------------------------------------------------------------------------------------------------------------
314
315function nakazit(thePlayer, nemoc, stadium)
316 if(getElementData(thePlayer, "loggedin") == 1)then
317 if(nemoce[nemoc])then
318 mysql:query_free("INSERT INTO nakazeni (postava,nemoc) VALUES ('"..(mysql:escape_string(getPlayerName(thePlayer))).."','"..(mysql:escape_string(nemoc)).."')")
319 setElementData(thePlayer,"nemoc",nemoc)
320 if stadium then
321 mysql:query_free("UPDATE nakazeni SET stadium = '"..(mysql:escape_string(stadium)).."' WHERE nemoc = '"..(mysql:escape_string(nemoc)).."' AND postava = '"..(mysql:escape_string(getPlayerName(thePlayer))).."'")
322 end
323 end
324 end
325end
326
327------------------------------------------------------------------------------------------------------------------------------
328
329-- Å IRENIE (( ADMIN PRÃVA ))
330
331------------------------------------------------------------------------------------------------------------------------------ VAS-73 - ED44-A - Chřipka - TUVN - Modecsia - Modecsia!2 - Lemoe
332
333function mojenemocadmin(thePlayer, cmd, nemoc)
334 if not (nemoc) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then
335 outputChatBox("SYNTAX: /"..cmd.." [Název choroby]",thePlayer,255, 194, 15)
336 outputChatBox("Chřipka - Modezia - Tulerin - Zápal plic - Rakovina - Rýma",thePlayer,255, 194, 15)
337 outputChatBox("Zadejte /choroby pro vÃce informacà o chorobách",thePlayer,255, 194, 15)
338 return
339 end
340 if(exports.integration:isPlayerTrialAdmin(thePlayer))then
341 if(nemoc)then
342 nakazit(thePlayer, nemoc)
343 outputChatBox("Úspěšně si se nakazil.",thePlayer,255, 194, 15)
344 end
345 end
346end
347addCommandHandler("nakazitme", mojenemocadmin, false, false)
348
349-- /CHOROBY
350
351function chorobylist(thePlayer, cmd)
352 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
353 outputChatBox("Seznam nemocà a jejich funkcÃ:",thePlayer,255, 194, 15)
354 outputChatBox("ChÅ™ipka - Å Ãrenie: Dychom, ZruÅ¡enie: ÄŒasom, HP: Neberie, Obraz: Žiadny, KaÅ¡eľ: Ãno,",thePlayer,255, 194, 15)
355 outputChatBox("Modezia - Å Ãrenie: Dotykom, ZruÅ¡enie: Žiadne, HP: Berie, Obraz: Rozmazaný, KaÅ¡eľ: Ãno",thePlayer,255, 194, 15)
356 outputChatBox("Tulerin - Å Ãrenie: Dychom, ZruÅ¡enie: Dlhodobé, HP: Berie, Obraz: Krvavý, KaÅ¡eľ: Zvracanie",thePlayer,255, 194, 15)
357 outputChatBox("Zápal plic - Å Ãrenie: Dychom, ZruÅ¡enie: Lieky, HP: Neberie, Obraz: Žiadny, KaÅ¡eľ: Ãno",thePlayer,255, 194, 15)
358 outputChatBox("Rakovina - Å Ãrenie: Žiadne, ZruÅ¡enie: Žiadne, HP: Berie, Obraz: Rozmazaný, KaÅ¡eľ: Nie",thePlayer,255, 194, 15)
359 outputChatBox("Rýma - Å Ãrenie: Žiadne, ZruÅ¡enie: Lieky, HP: Neberie, Obraz: Žiadny, KaÅ¡eľ: Ãno",thePlayer,255, 194, 15)
360 end
361end
362addCommandHandler("choroby", chorobylist, false, false)
363addCommandHandler("nemoce", chorobylist, false, false)
364
365-- /NEMOCECMD
366
367function nemocecmd(thePlayer, cmd)
368 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
369 outputChatBox("Seznam pÅ™Ãkazů k skriptu nemoci:",thePlayer,255, 194, 15)
370 outputChatBox("/nakazit - Nakazà zvoleného hráÄe",thePlayer,255, 194, 15)
371 outputChatBox("/vylecit - VyléÄi zvoleného hráÄe",thePlayer,255, 194, 15)
372 outputChatBox("/nemoce - Zobrazà seznam vÅ¡ech nemocÃ",thePlayer,255, 194, 15)
373 outputChatBox("/nakazitme - Nakazà sebe",thePlayer,255, 194, 15)
374 outputChatBox("/mojenemoc - Zobrazà svoji nemoc",thePlayer,255, 194, 15)
375 outputChatBox("/jehonemoc - Zobrazà nemoc hráÄe",thePlayer,255, 194, 15)
376 outputChatBox("/lekylist - Zobrazà seznam léků",thePlayer,255, 194, 15)
377 end
378end
379addCommandHandler("nemocecmd", nemocecmd, false, false)
380addCommandHandler("chorobycmd", nemocecmd, false, false)
381
382-- /LEKY
383
384function lekylist(thePlayer, cmd)
385 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
386 outputChatBox("Seznam léků k skriptu nemoci:",thePlayer,255, 194, 15)
387 outputChatBox("Pro zobrazenà co lék léÄà zadej /<název léku>",thePlayer,255, 194, 15)
388 outputChatBox("Celaskon",thePlayer,255, 194, 15)
389 outputChatBox("Paralen",thePlayer,255, 194, 15)
390 outputChatBox("Oscillococcinum",thePlayer,255, 194, 15)
391 outputChatBox("Valetol",thePlayer,255, 194, 15)
392 outputChatBox("Nalgesin S",thePlayer,255, 194, 15)
393 outputChatBox("Grippostad C",thePlayer,255, 194, 15)
394 outputChatBox("Ospen 1500",thePlayer,255, 194, 15)
395 end
396end
397addCommandHandler("lekylist", lekylist, false, false)
398addCommandHandler("liekylist", lekylist, false, false)
399
400-- /CELASKON
401
402function celaskon(thePlayer, cmd)
403 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
404 outputChatBox("Název léku: Celaskon",thePlayer,255, 194, 15)
405 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
406 outputChatBox("Zápal plic (1,40)==26",thePlayer,255, 194, 15)
407 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
408 end
409end
410addCommandHandler("celaskon", celaskon, false, false)
411
412-- /PARALEN
413
414function paralen(thePlayer, cmd)
415 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
416 outputChatBox("Název léku: Paralen",thePlayer,255, 194, 15)
417 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
418 outputChatBox("Zápal plic (1,40)==20",thePlayer,255, 194, 15)
419 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
420 end
421end
422addCommandHandler("paralen", paralen, false, false)
423
424-- /OSCILLOCOCCINUM
425
426function oscillococcinum(thePlayer, cmd)
427 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
428 outputChatBox("Název léku: Oscillococcinum",thePlayer,255, 194, 15)
429 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
430 outputChatBox("Zápal plic (1,40)==25",thePlayer,255, 194, 15)
431 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
432 end
433end
434addCommandHandler("oscillococcinum", oscillococcinum, false, false)
435addCommandHandler("oscillo", oscillococcinum, false, false)
436
437-- /VALETOL
438
439function valetol(thePlayer, cmd)
440 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
441 outputChatBox("Název léku: Valetol",thePlayer,255, 194, 15)
442 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
443 outputChatBox("Zápal plic (1,40)==21",thePlayer,255, 194, 15)
444 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
445 end
446end
447addCommandHandler("valetol", valetol, false, false)
448
449-- /NALGESIN
450
451function nalgesin(thePlayer, cmd)
452 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
453 outputChatBox("Název léku: Nalgesin",thePlayer,255, 194, 15)
454 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
455 outputChatBox("Zápal plic (1,40)==23",thePlayer,255, 194, 15)
456 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
457 end
458end
459addCommandHandler("nalgesins", nalgesin, false, false)
460addCommandHandler("nalgesin", nalgesin, false, false)
461
462-- /GRIPPOSTADC
463
464function grippostadc(thePlayer, cmd)
465 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
466 outputChatBox("Název léku: Grippostad",thePlayer,255, 194, 15)
467 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
468 outputChatBox("Zápal plic (1,40)==24",thePlayer,255, 194, 15)
469 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
470 end
471end
472addCommandHandler("grippostadc", grippostadc, false, false)
473addCommandHandler("grippostad", grippostad, false, false)
474
475-- /OSPEN
476
477function ospen(thePlayer, cmd)
478 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
479 outputChatBox("Název léku: Grippostad",thePlayer,255, 194, 15)
480 outputChatBox("Zápal plic (1,20)==15",thePlayer,255, 194, 15)
481 outputChatBox("Chřipka (1,30)==12",thePlayer,255, 194, 15)
482 end
483end
484addCommandHandler("ospen", ospen, false, false)
485
486------------------------------------------------------------------------------------------------------------------------------
487
488-- Å ÃRENIE CHOROBY VDAKA NEJAKEMU ODPADU, NERIESIT, NENI NA MAPE
489
490------------------------------------------------------------------------------------------------------------------------------
491
492bioWaste = createColSphere(1271.635, 295.338, 20.256, 6)
493function hitBioWaste(thePlayer, matchingDimension)
494 if(getElementType(thePlayer)=="player" and matchingDimension)then
495 if(not(getElementData(thePlayer, "gasmask")))then
496 nakazit(thePlayer, "Modecsia")
497 end
498 end
499end
500addEventHandler("onColShapeHit", bioWaste, hitBioWaste)
501
502------------------------------------------------------------------------------------------------------------------------------
503
504-- VYLIEÄŒIŤ HRÃÄŒA (( ADMIN PRÃVA ))
505
506------------------------------------------------------------------------------------------------------------------------------
507
508function vyliecit(thePlayer,cmd,...)
509 if not (...) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then outputChatBox("SYNTAX: /"..cmd.." [Jméno hráÄe]",thePlayer,255, 194, 15) return end
510 local osoba = exports.global:findPlayerByPartialNick(thePlayer, table.concat({...},"_"))
511 if not (getElementData(osoba,"nemoc")) then outputChatBox("HrÃ¡Ä nenà nakažený.",thePlayer) return end
512 local meno = getPlayerName(osoba):gsub("_"," ")
513 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(osoba))).."'")
514 removeElementData(osoba,"nemoc")
515 removeElementData(osoba,"nemoc:obraz")
516 outputChatBox("Úspěšne si vyléÄil hráÄe "..meno,thePlayer,255, 194, 15)
517end
518addCommandHandler("vylecit",vyliecit,false,false)
519
520------------------------------------------------------------------------------------------------------------------------------
521
522-- NAKAZIŤ HRÃÄŒA (( ADMIN PRÃVA ))
523
524------------------------------------------------------------------------------------------------------------------------------
525
526function nakazithraca(thePlayer, cmd, nemoc, ...)
527 if not (nemoc) or not (...) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then
528 outputChatBox("SYNTAX: /"..cmd.." [Název choroby] [Jméno hráÄe]",thePlayer,255, 194, 15)
529 outputChatBox("Chřipka - Modezia - Tulerin - Zápal plic - Rakovina - Rýma",thePlayer,255, 194, 15)
530 outputChatBox("Zadejte /choroby pro vÃce informacà o chorobách",thePlayer,255, 194, 15)
531 return
532 end
533 if(exports.integration:isPlayerTrialAdmin(thePlayer))then
534 if(nemoc) and (...) then
535 local osoba = exports.global:findPlayerByPartialNick(thePlayer, table.concat({...},"_"))
536 nakazit(osoba, nemoc)
537 local meno = getPlayerName(osoba):gsub("_"," ")
538 outputChatBox("ÚspěšnÄ› si nakazil hráÄe "..meno,thePlayer,255, 194, 15)
539 end
540 end
541end
542addCommandHandler("nakazit", nakazithraca, false, false)
543
544------------------------------------------------------------------------------------------------------------------------------
545
546-- ZISTENIE VLASTNEJ CHOROBY
547
548------------------------------------------------------------------------------------------------------------------------------
549
550function skap(thePlayer, cmd)
551 if (getElementData(thePlayer, "nemoc")) then
552 outputChatBox("Tvá nemoc: "..getElementData(thePlayer,"nemoc"), thePlayer,255, 194, 15)
553 else
554 outputChatBox("Nejsi nakažený.", thePlayer,255, 194, 15)
555 end
556end
557addCommandHandler("mojenemoc", skap, false, false)
558
559------------------------------------------------------------------------------------------------------------------------------
560
561-- ZISTENIE CHOROBY DRUHEHO HRACA
562
563------------------------------------------------------------------------------------------------------------------------------
564
565function tvojenemoc(thePlayer, cmd, ...)
566 if not (...) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then outputChatBox("SYNTAX: /"..cmd.." [Jméno hráÄe]",thePlayer,255, 194, 15) return end
567 local osoba = exports.global:findPlayerByPartialNick(thePlayer, table.concat({...},"_"))
568 if (getElementData(osoba, "nemoc")) then
569 outputChatBox(getElementData(osoba,"nemoc"), thePlayer)
570 else
571 outputChatBox(getPlayerName(osoba):gsub("_"," ").." nenà nakažený", thePlayer,255, 194, 15)
572 end
573end
574addCommandHandler("jehonemoc", tvojenemoc, false, false)
575
576
577--DATABAZA
578--[[
579CREATE TABLE IF NOT EXISTS `nakazeni` (
580 `id` int(255) NOT NULL AUTO_INCREMENT,
581 `postava` varchar(255) NOT NULL,
582 `nemoc` varchar(255) NOT NULL,
583 `stadium` int(255) NOT NULL DEFAULT '1',
584 `nakazil` int(255) NOT NULL DEFAULT '0',
585 PRIMARY KEY (`id`),
586 UNIQUE KEY `postava` (`postava`)
587) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=83 ;
588
589 [382] = { "Celaskon 150mg", "Celaskon s #v práškami uvnitř.", 6, 1575, 270, 0, 0, 0.1, weight = function(v) return 0.1 + v*0.03 end },
590 [383] = { "Prášek Celaskon", "Vitaminy jsou složité látky nezbytné pro mnohé funkce v organismu.", 3, 1580, 0, 0, 0, 0, weight = 0.1 },
591
592 [384] = { "Paralen 500mg", "Paralen s #v práškami uvnitř.", 6, 1575, 270, 0, 0, 0.1, weight = function(v) return 0.1 + v*0.03 end },
593 [385] = { "Prášek Paralen", "Prášek Paralen 500 je urÄen ke snÞenà horeÄky a bolesti pÅ™i chÅ™ipce, nachlazenà a jiných infekÄnÃch onemocnÄ›nÃch.", 3, 1580, 0, 0, 0, 0, weight = 0.1 },
594
595 [386] = { "Oscillococcinum 1g", "Oscillococcinum s #v pilulkami uvnitÅ™.", 6, 1575, 270, 0, 0, 0.1, weight = function(v) return 0.1 + v*0.03 end },
596 [387] = { "Pilulka Oscillococcinum", "Homeopatický lék, tradiÄnÄ› použÃvaný pÅ™i léÄbÄ› chÅ™ipkových stavů (horeÄka, nachlazenÃ, bolesti).", 3, 1580, 0, 0, 0, 0, weight = 0.1 },
597
598 [388] = { "Valetol 150mg", "Valetol s #v práškami uvnitř.", 6, 1575, 270, 0, 0, 0.1, weight = function(v) return 0.1 + v*0.03 end },
599 [389] = { "Prášek Valetol", "Prášek Valetol je složený pÅ™Ãpravek obsahujÃcà Propyfenazon, paracetamol a kofein.", 3, 1580, 0, 0, 0, 0, weight = 0.1 },
600
601 [340] = { "Nalgesin S 275mg", "Nalgesin S s #v práškami uvnitř.", 6, 1575, 270, 0, 0, 0.1, weight = function(v) return 0.1 + v*0.03 end },
602 [341] = { "Prášek Nalgesin S", "Nalgesin S je lék na zmÃrnÄ›nà různých druhů bolestÃ, k léÄbÄ› zánÄ›tlivých onemocnÄ›nà a snižovánà horeÄky.", 3, 1580, 0, 0, 0, 0, weight = 0.1 },
603
604 [342] = { "Grippostad C 200mg", "Grippostad s #v práškami uvnitř.", 6, 1575, 270, 0, 0, 0.1, weight = function(v) return 0.1 + v*0.03 end },
605 [343] = { "Prášek Grippostad C", "Grippostad C zmÃrňuje bolest a snižuje horeÄku. PoužÃvá se k léÄbÄ› pÅ™Ãznaků chÅ™ipkových infekcà a pÅ™i nachlazenÃ.", 3, 1580, 0, 0, 0, 0, weight = 0.1 },
606
607 [344] = { "Ospen 1500", "Ospen 1500 #v práškami uvnitř.", 6, 1575, 270, 0, 0, 0.1, weight = function(v) return 0.1 + v*0.03 end },
608 [345] = { "Prášek Ospen", "PÅ™Ãpravek Ospen je antibiotikum, které hubà bakterie způsobujÃcà infekce.", 3, 1580, 0, 0, 0, 0, weight = 0.1 },]]