· 7 years ago · Feb 01, 2019, 08:06 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 if(math.random(1,10)==15)then
240 exports['anticheat']:changeProtectedElementDataEx(v, "nemoc", nemoc)
241 mysql:query_free("UPDATE nakazeni SET nakazil = nakazil + 1 WHERE postava = '"..(mysql:escape_string(getPlayerName(player))).."'")
242 mysql:query_free("INSERT INTO nakazeni (postava,nemoc,stadium) VALUES ('"..(mysql:escape_string(getPlayerName(v))).."','"..(nemoc).."',1)")
243 end
244 end
245 destroyElement(newcolshape)
246 end
247
248------------------------------------------------------------------------------------------------------------------------------
249
250-- ZRUÅ ENIE ÄŒASOM A DLHODOBO
251
252------------------------------------------------------------------------------------------------------------------------------
253
254 if(nemoce[nemoc][2] == 2)then
255 if(math.random(1,30)==15)then
256 removeElementData(player, "nemoc")
257 removeElementData(player, "nemoc:obraz")
258 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(player))).."' AND nemoc = '"..(mysql:escape_string(nemoc)).."'")
259 end
260 elseif(nemoce[nemoc][2] == 3)then
261 if(math.random(1,40)==20 and getElementDimension(player)==93)then
262 removeElementData(player, "nemoc")
263 removeElementData(player, "nemoc:obraz")
264 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(player))).."' AND nemoc = '"..(mysql:escape_string(nemoc)).."'")
265 end
266 end
267end
268
269------------------------------------------------------------------------------------------------------------------------------
270
271-- Å ÃRENIE DOTYKOM
272
273------------------------------------------------------------------------------------------------------------------------------
274function infectsirit(attacker, weapon, bodypart, loss)
275 if(attacker and getElementType(attacker)=="player")then
276 if(weapon<16)then
277 local nemo = getElementData(attacker, "nemoc")
278 if(nemo)then
279 if(nemoce[nemo][1]==1 or nemoce[nemo][1]==2)then
280 if(not(getElementData(source, "nemoc")==nemo))then
281 mysql:query_free("UPDATE nakazeni SET nakazil = nakazil + 1 WHERE postava = '"..(mysql:escape_string(getPlayerName(attacker))).."'")
282 mysql:query_free("INSERT INTO nakazeni (postava,nemoc) VALUES ('"..(mysql:escape_string(getPlayerName(source))).."','"..(mysql:escape_string(nemo)).."')")
283 end
284 end
285 end
286 end
287 end
288end
289addEventHandler("onPlayerDamage", getRootElement(), infectsirit)
290
291------------------------------------------------------------------------------------------------------------------------------
292
293-- VYLIEÄŒENIE
294
295------------------------------------------------------------------------------------------------------------------------------
296
297
298function vylecit(thePlayer, nemoc, forced)
299 if(getElementData(thePlayer, "loggedin") == 1)then
300 if(nemoce[nemoc])then
301 if(nemoce[nemoc][2]==1 or forced)then
302 removeElementData(thePlayer, "nemoc")
303 removeElementData(thePlayer, "nemoc:obraz")
304 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(thePlayer))).."' AND nemoc = '"..(mysql:escape_string(nemoc)).."'")
305 end
306 end
307 end
308end
309
310------------------------------------------------------------------------------------------------------------------------------
311
312-- NAKAZENIE
313
314------------------------------------------------------------------------------------------------------------------------------
315
316function nakazit(thePlayer, nemoc, stadium)
317 if(getElementData(thePlayer, "loggedin") == 1)then
318 if(nemoce[nemoc])then
319 mysql:query_free("INSERT INTO nakazeni (postava,nemoc) VALUES ('"..(mysql:escape_string(getPlayerName(thePlayer))).."','"..(mysql:escape_string(nemoc)).."')")
320 setElementData(thePlayer,"nemoc",nemoc)
321 if stadium then
322 mysql:query_free("UPDATE nakazeni SET stadium = '"..(mysql:escape_string(stadium)).."' WHERE nemoc = '"..(mysql:escape_string(nemoc)).."' AND postava = '"..(mysql:escape_string(getPlayerName(thePlayer))).."'")
323 end
324 end
325 end
326end
327
328------------------------------------------------------------------------------------------------------------------------------
329
330-- Å IRENIE (( ADMIN PRÃVA ))
331
332------------------------------------------------------------------------------------------------------------------------------ VAS-73 - ED44-A - Chřipka - TUVN - Modecsia - Modecsia!2 - Lemoe
333
334function mojenemocadmin(thePlayer, cmd, nemoc)
335 if not (nemoc) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then
336 outputChatBox("SYNTAX: /"..cmd.." [Název choroby]",thePlayer,255, 194, 15)
337 outputChatBox("Chřipka - Modezia - Tulerin - Zápal plic - Rakovina - Rýma",thePlayer,255, 194, 15)
338 outputChatBox("Zadejte /choroby pro vÃce informacà o chorobách",thePlayer,255, 194, 15)
339 return
340 end
341 if(exports.integration:isPlayerTrialAdmin(thePlayer))then
342 if(nemoc)then
343 nakazit(thePlayer, nemoc)
344 outputChatBox("Úspěšně si se nakazil.",thePlayer,255, 194, 15)
345 end
346 end
347end
348addCommandHandler("nakazitme", mojenemocadmin, false, false)
349
350-- /CHOROBY
351
352function chorobylist(thePlayer, cmd)
353 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
354 outputChatBox("",thePlayer,255, 194, 15)
355 outputChatBox("Seznam nemocà a jejich funkcÃ:",thePlayer,255, 194, 15)
356 outputChatBox("ChÅ™ipka - Å Ãrenie: Dychom, ZruÅ¡enie: ÄŒasom, HP: Neberie, Obraz: Žiadny, KaÅ¡eľ: Ãno,",thePlayer,255, 194, 15)
357 outputChatBox("Modezia - Å Ãrenie: Dotykom, ZruÅ¡enie: Žiadne, HP: Berie, Obraz: Rozmazaný, KaÅ¡eľ: Ãno",thePlayer,255, 194, 15)
358 outputChatBox("Tulerin - Å Ãrenie: Dychom, ZruÅ¡enie: Dlhodobé, HP: Berie, Obraz: Krvavý, KaÅ¡eľ: Zvracanie",thePlayer,255, 194, 15)
359 outputChatBox("Zápal plic - Å Ãrenie: Dychom, ZruÅ¡enie: Lieky, HP: Neberie, Obraz: Žiadny, KaÅ¡eľ: Ãno",thePlayer,255, 194, 15)
360 outputChatBox("Rakovina - Å Ãrenie: Žiadne, ZruÅ¡enie: Žiadne, HP: Berie, Obraz: Rozmazaný, KaÅ¡eľ: Nie",thePlayer,255, 194, 15)
361 outputChatBox("Rýma - Å Ãrenie: Žiadne, ZruÅ¡enie: Lieky, HP: Neberie, Obraz: Žiadny, KaÅ¡eľ: Ãno",thePlayer,255, 194, 15)
362 end
363end
364addCommandHandler("choroby", chorobylist, false, false)
365addCommandHandler("nemoce", chorobylist, false, false)
366
367-- /NEMOCECMD
368
369function nemocecmd(thePlayer, cmd)
370 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
371 outputChatBox("",thePlayer,255, 194, 15)
372 outputChatBox("Seznam pÅ™Ãkazů k skriptu nemoci:",thePlayer,255, 194, 15)
373 outputChatBox("/nakazit - Nakazà zvoleného hráÄe",thePlayer,255, 194, 15)
374 outputChatBox("/vylecit - VyléÄi zvoleného hráÄe",thePlayer,255, 194, 15)
375 outputChatBox("/nemoce - Zobrazà seznam vÅ¡ech nemocÃ",thePlayer,255, 194, 15)
376 outputChatBox("/nakazitme - Nakazà sebe",thePlayer,255, 194, 15)
377 outputChatBox("/mojenemoc - Zobrazà svoji nemoc",thePlayer,255, 194, 15)
378 outputChatBox("/jehonemoc - Zobrazà nemoc hráÄe",thePlayer,255, 194, 15)
379 outputChatBox("/lekylist - Zobrazà seznam léků",thePlayer,255, 194, 15)
380 end
381end
382addCommandHandler("nemocecmd", nemocecmd, false, false)
383addCommandHandler("chorobycmd", nemocecmd, false, false)
384
385-- /LEKY
386
387function lekylist(thePlayer, cmd)
388 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
389 outputChatBox("",thePlayer,255, 194, 15)
390 outputChatBox("Seznam léků k skriptu nemoci:",thePlayer,255, 194, 15)
391 outputChatBox("Pro zobrazenà co lék léÄà zadej /<název léku>",thePlayer,255, 194, 15)
392 outputChatBox("Celaskon",thePlayer,255, 194, 15)
393 outputChatBox("Paralen",thePlayer,255, 194, 15)
394 outputChatBox("Oscillococcinum",thePlayer,255, 194, 15)
395 outputChatBox("Valetol",thePlayer,255, 194, 15)
396 outputChatBox("Nalgesin S",thePlayer,255, 194, 15)
397 outputChatBox("Grippostad C",thePlayer,255, 194, 15)
398 outputChatBox("Ospen 1500",thePlayer,255, 194, 15)
399 end
400end
401addCommandHandler("lekylist", lekylist, false, false)
402addCommandHandler("liekylist", lekylist, false, false)
403
404-- /CELASKON
405
406function celaskon(thePlayer, cmd)
407 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
408 outputChatBox("",thePlayer,255, 194, 15)
409 outputChatBox("Název léku: Celaskon",thePlayer,255, 194, 15)
410 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
411 outputChatBox("Zápal plic (1,40)==26",thePlayer,255, 194, 15)
412 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
413 end
414end
415addCommandHandler("celaskon", celaskon, false, false)
416
417-- /PARALEN
418
419function paralen(thePlayer, cmd)
420 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
421 outputChatBox("",thePlayer,255, 194, 15)
422 outputChatBox("Název léku: Paralen",thePlayer,255, 194, 15)
423 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
424 outputChatBox("Zápal plic (1,40)==20",thePlayer,255, 194, 15)
425 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
426 end
427end
428addCommandHandler("paralen", paralen, false, false)
429
430-- /OSCILLOCOCCINUM
431
432function oscillococcinum(thePlayer, cmd)
433 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
434 outputChatBox("",thePlayer,255, 194, 15)
435 outputChatBox("Název léku: Oscillococcinum",thePlayer,255, 194, 15)
436 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
437 outputChatBox("Zápal plic (1,40)==25",thePlayer,255, 194, 15)
438 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
439 end
440end
441addCommandHandler("oscillococcinum", oscillococcinum, false, false)
442addCommandHandler("oscillo", oscillococcinum, false, false)
443
444-- /VALETOL
445
446function valetol(thePlayer, cmd)
447 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
448 outputChatBox("",thePlayer,255, 194, 15)
449 outputChatBox("Název léku: Valetol",thePlayer,255, 194, 15)
450 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
451 outputChatBox("Zápal plic (1,40)==21",thePlayer,255, 194, 15)
452 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
453 end
454end
455addCommandHandler("valetol", valetol, false, false)
456
457-- /NALGESIN
458
459function nalgesin(thePlayer, cmd)
460 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
461 outputChatBox("",thePlayer,255, 194, 15)
462 outputChatBox("Název léku: Nalgesin",thePlayer,255, 194, 15)
463 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
464 outputChatBox("Zápal plic (1,40)==23",thePlayer,255, 194, 15)
465 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
466 end
467end
468addCommandHandler("nalgesins", nalgesin, false, false)
469addCommandHandler("nalgesin", nalgesin, false, false)
470
471-- /GRIPPOSTADC
472
473function grippostadc(thePlayer, cmd)
474 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
475 outputChatBox("",thePlayer,255, 194, 15)
476 outputChatBox("Název léku: Grippostad",thePlayer,255, 194, 15)
477 outputChatBox("Rýma (1,25)==12",thePlayer,255, 194, 15)
478 outputChatBox("Zápal plic (1,40)==24",thePlayer,255, 194, 15)
479 outputChatBox("Chřipka (1,30)==15",thePlayer,255, 194, 15)
480 end
481end
482addCommandHandler("grippostadc", grippostadc, false, false)
483addCommandHandler("grippostad", grippostad, false, false)
484
485-- /OSPEN
486
487function ospen(thePlayer, cmd)
488 if (exports.integration:isPlayerTrialAdmin(thePlayer)) then
489 outputChatBox("",thePlayer,255, 194, 15)
490 outputChatBox("Název léku: Ospen",thePlayer,255, 194, 15)
491 outputChatBox("Zápal plic (1,20)==15",thePlayer,255, 194, 15)
492 outputChatBox("Chřipka (1,30)==12",thePlayer,255, 194, 15)
493 end
494end
495addCommandHandler("ospen", ospen, false, false)
496
497------------------------------------------------------------------------------------------------------------------------------
498
499-- Å ÃRENIE CHOROBY VDAKA NEJAKEMU ODPADU, NERIESIT, NENI NA MAPE
500
501------------------------------------------------------------------------------------------------------------------------------
502
503bioWaste = createColSphere(1271.635, 295.338, 20.256, 6)
504function hitBioWaste(thePlayer, matchingDimension)
505 if(getElementType(thePlayer)=="player" and matchingDimension)then
506 if(not(getElementData(thePlayer, "gasmask")))then
507 nakazit(thePlayer, "Modecsia")
508 end
509 end
510end
511addEventHandler("onColShapeHit", bioWaste, hitBioWaste)
512
513------------------------------------------------------------------------------------------------------------------------------
514
515-- VYLIEÄŒIŤ HRÃÄŒA (( ADMIN PRÃVA ))
516
517------------------------------------------------------------------------------------------------------------------------------
518
519function vyliecit(thePlayer,cmd,...)
520 if not (...) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then outputChatBox("SYNTAX: /"..cmd.." [Jméno hráÄe]",thePlayer,255, 194, 15) return end
521 local osoba = exports.global:findPlayerByPartialNick(thePlayer, table.concat({...},"_"))
522 if not (getElementData(osoba,"nemoc")) then outputChatBox("HrÃ¡Ä nenà nakažený.",thePlayer) return end
523 local meno = getPlayerName(osoba):gsub("_"," ")
524 mysql:query_free("DELETE FROM nakazeni WHERE postava = '"..(mysql:escape_string(getPlayerName(osoba))).."'")
525 removeElementData(osoba,"nemoc")
526 removeElementData(osoba,"nemoc:obraz")
527 outputChatBox("Úspěšne si vyléÄil hráÄe "..meno,thePlayer,255, 194, 15)
528end
529addCommandHandler("vylecit",vyliecit,false,false)
530
531------------------------------------------------------------------------------------------------------------------------------
532
533-- NAKAZIŤ HRÃÄŒA (( ADMIN PRÃVA ))
534
535------------------------------------------------------------------------------------------------------------------------------
536
537function nakazithraca(thePlayer, cmd, nemoc, ...)
538 if not (nemoc) or not (...) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then
539 outputChatBox("SYNTAX: /"..cmd.." [Název choroby] [Jméno hráÄe]",thePlayer,255, 194, 15)
540 outputChatBox("Chřipka - Modezia - Tulerin - Zápal plic - Rakovina - Rýma",thePlayer,255, 194, 15)
541 outputChatBox("Zadejte /choroby pro vÃce informacà o chorobách",thePlayer,255, 194, 15)
542 return
543 end
544 if(exports.integration:isPlayerTrialAdmin(thePlayer))then
545 if(nemoc) and (...) then
546 local osoba = exports.global:findPlayerByPartialNick(thePlayer, table.concat({...},"_"))
547 nakazit(osoba, nemoc)
548 local meno = getPlayerName(osoba):gsub("_"," ")
549 outputChatBox("ÚspěšnÄ› si nakazil hráÄe "..meno,thePlayer,255, 194, 15)
550 end
551 end
552end
553addCommandHandler("nakazit", nakazithraca, false, false)
554
555------------------------------------------------------------------------------------------------------------------------------
556
557-- ZISTENIE VLASTNEJ CHOROBY
558
559------------------------------------------------------------------------------------------------------------------------------
560
561function skap(thePlayer, cmd)
562 if (getElementData(thePlayer, "nemoc")) then
563 outputChatBox("Tvá nemoc: "..getElementData(thePlayer,"nemoc"), thePlayer,255, 194, 15)
564 else
565 outputChatBox("Nejsi nakažený.", thePlayer,255, 194, 15)
566 end
567end
568addCommandHandler("mojenemoc", skap, false, false)
569
570------------------------------------------------------------------------------------------------------------------------------
571
572-- ZISTENIE CHOROBY DRUHEHO HRACA
573
574------------------------------------------------------------------------------------------------------------------------------
575
576function tvojenemoc(thePlayer, cmd, ...)
577 if not (...) or not (exports.integration:isPlayerTrialAdmin(thePlayer))then outputChatBox("SYNTAX: /"..cmd.." [Jméno hráÄe]",thePlayer,255, 194, 15) return end
578 local osoba = exports.global:findPlayerByPartialNick(thePlayer, table.concat({...},"_"))
579 if (getElementData(osoba, "nemoc")) then
580 outputChatBox(getElementData(osoba,"nemoc"), thePlayer)
581 else
582 outputChatBox(getPlayerName(osoba):gsub("_"," ").." nenà nakažený", thePlayer,255, 194, 15)
583 end
584end
585addCommandHandler("jehonemoc", tvojenemoc, false, false)
586
587
588--DATABAZA
589--[[
590CREATE TABLE IF NOT EXISTS `nakazeni` (
591 `id` int(255) NOT NULL AUTO_INCREMENT,
592 `postava` varchar(255) NOT NULL,
593 `nemoc` varchar(255) NOT NULL,
594 `stadium` int(255) NOT NULL DEFAULT '1',
595 `nakazil` int(255) NOT NULL DEFAULT '0',
596 PRIMARY KEY (`id`),
597 UNIQUE KEY `postava` (`postava`)
598) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=83 ;
599
600 [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 },
601 [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 },
602
603 [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 },
604 [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 },
605
606 [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 },
607 [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 },
608
609 [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 },
610 [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 },
611
612 [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 },
613 [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 },
614
615 [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 },
616 [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 },
617
618 [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 },
619 [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 },]]