Medic blib zeigt nicht an

  • Vio Lite/Extended

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Medic blib zeigt nicht an

    Moin,
    bin gerade dabei die Medicfraktion ins Extendedscript einzufügen was auch ganz gut klappt bis auf dass auf der map nicht angezeigt wird wo der tote sich befindet. Kann mir wer den Fehler nennen?

    Quellcode

    1. local m_pick = {}
    2. local m_mark = {}
    3. local m_blip = {}
    4. function medicdeleteBlip_func()
    5. local thePlayer = source
    6. setElementVisibleTo ( m_blip[thePlayer], getRootElement(), false )
    7. setElementVisibleTo ( m_mark[thePlayer], getRootElement(), false )
    8. setElementVisibleTo ( m_pick[thePlayer], getRootElement(), false )
    9. destroyElement(m_pick[thePlayer])
    10. destroyElement(m_mark[thePlayer])
    11. destroyElement(m_blip[thePlayer])
    12. end
    13. local deathReasons = {
    14. [19] = "Rakete",
    15. [37] = "Verbrannt",
    16. [49] = "Gerammt",
    17. [50] = "Rotorblätter",
    18. [51] = "Explosion",
    19. [52] = "Driveby",
    20. [53] = "Ertrunken",
    21. [54] = "Gestürzt",
    22. [55] = "Unbekannt",
    23. [56] = "Faust",
    24. [57] = "Waffe",
    25. [59] = "Panzer-Granate",
    26. [63] = "Fahrzeugexplosion"
    27. }
    28. local revivetimer = {}
    29. function playerdeath ( ammo, killer, weapon, part )
    30. local player = source
    31. vioGetElementData ( player, "alcoholFlushPoints", 0 )
    32. vioGetElementData ( player, "weedFlushPoints", 0 )
    33. vioGetElementData ( player, "koksFlushPoints", 0 )
    34. vioGetElementData ( player, "cigarettFlushPoints", 0 )
    35. if part then
    36. if part == 9 then
    37. setPedHeadless ( player, true )
    38. end
    39. end
    40. if getElementData ( player, "In_DMArena" ) == 1 then
    41. else
    42. if isKeyBound ( player, "enter_exit", "down", heliCoSeat ) then
    43. heliCoSeat ( player )
    44. end
    45. if not vioGetElementData ( player, "isInHighNoon" ) and ( not getElementData ( player, "In_DMArena" ) or getElementData ( player, "In_DMArena" ) == 0 ) then
    46. vioGetElementData ( player, "hunger", 40 )
    47. --hideTruckMarkers ( player )
    48. if vioGetElementData ( player, "callswith" ) then
    49. if vioGetElementData ( player, "callswith" ) ~= "none" then
    50. local caller = getPlayerFromName ( vioGetElementData ( player, "callswith" ) )
    51. if caller then
    52. vioGetElementData ( caller, "callswith", "none" )
    53. vioGetElementData ( caller, "call", false )
    54. vioGetElementData ( caller, "calls", "none" )
    55. vioGetElementData ( caller, "callswith", "none" )
    56. vioGetElementData ( caller, "calledby", "none" )
    57. outputChatBox ( "*Knack* - Die Leitung ist tod!", caller, 125, 0, 0 )
    58. end
    59. vioGetElementData ( player, "callswith", "none" )
    60. vioGetElementData ( player, "call", false )
    61. vioGetElementData ( player, "calls", "none" )
    62. vioGetElementData ( player, "callswith", "none" )
    63. vioGetElementData ( player, "calledby", "none" )
    64. end
    65. end
    66. if vioGetElementData ( player, "isInDrivingSchool" ) then
    67. cancelDrivingSchoolPlayer ( player )
    68. end
    69. if getPedOccupiedVehicle ( player ) then
    70. removePedFromVehicle ( player )
    71. end
    72. if isElement ( killer ) and killer ~= player and getPlayerName ( killer ) and weapon and not isOnStateDuty ( killer ) then
    73. outputLog ( "[KILL]: "..getPlayerName ( killer ).." hat "..getPlayerName(player).." mit Waffe "..weapon.." erledigt!", "death" )
    74. if fraktion == 0 or isMedic(player) or isReporter(player) or isStateFaction(player) then
    75. local x, y, z = getElementPosition ( player )
    76. local killShape = createColSphere ( x, y, z, 10 )
    77. local elementsInKillSphere = getElementsWithinColShape ( killShape, "player" )
    78. destroyElement ( killShape )
    79. local x1, y1, z1 = getElementPosition ( player )
    80. local x2, y2, z2 = getElementPosition ( killer )
    81. local location = getZoneName ( x1, y1, z1 )
    82. local city = getZoneName ( x1, y1, z1, true )
    83. --[[for key, ShapePlayer in ipairs ( elementsInKillSphere ) do
    84. if vioGetElementData ( ShapePlayer, "handsuped" ) or getElementData ( ShapePlayer, "tiedsecur") or isPedDead ( ShapePlayer) then
    85. elseif killer == ShapePlayer then
    86. else
    87. outputChatBox ( "In deiner Nähe ist ein Mord geschehen! Du kannst ihn mit /mord melden!", ShapePlayer, 225, 225, 0 )
    88. vioGetElementData (ShapePlayer, "killedPlayer", getPlayerName(player))
    89. vioGetElementData (ShapePlayer, "killerPlayer", attacker)
    90. vioGetElementData (ShapePlayer, "killedLocation", location)
    91. vioGetElementData (ShapePlayer, "killedCity", location)
    92. vioGetElementData (ShapePlayer, "SawMord", true)
    93. mordablauftimer = setTimer (mordnichtgemeldet, 300000, 1, ShapePlayer)
    94. if vioGetElementData (killer, "Mordgesehen") == true then
    95. else
    96. vioGetElementData (killer, "Mordgesehen", true)
    97. end
    98. if isOnStateDuty(ShapePlayer) then
    99. vioGetElementData (killer, "lastcrime", "mord" )
    100. moerdtimer = setTimer (moerdzuruck, 300000, 1, killer)
    101. end
    102. end
    103. end]]
    104. end
    105. elseif killer == false and weapon then
    106. local grund = deathReasons[weapon]
    107. outputLog ( "[TOD]: "..getPlayerName(player).." ist gestorben. Grund: "..grund..".", "death" )
    108. end
    109. vioGetElementData ( player, "isinairportmission", false )
    110. vioGetElementData ( player, "readyequip", false )
    111. setPlayerNametagColor ( player, 200, 200, 200 )
    112. vioGetElementData ( player, "isInRace", false )
    113. unbindKey ( player, "mouse_wheel_up", "down", weaponsup )
    114. unbindKey ( player, "mouse_wheel_down", "down", weaponsdown )
    115. unbindKey ( player , "g", "down", rein )
    116. unbindKey ( player, "enter", "down", eject )
    117. unbindKey ( player, "rshift", "down", helidriveby )
    118. unbindKey ( player, "1", "down", tazer_func )
    119. vioGetElementData ( player, "heaventime", 60 )
    120. setTimer ( endfade, 5000, 1, player )
    121. local hitmanbonustime = 0
    122. vioGetElementData ( player, "hitmandeath", false )
    123. if isHitman ( killer ) then
    124. local contract = vioGetElementData ( player, "contract" )
    125. if contract > 0 then
    126. vioGetElementData ( player, "hitmandeath", true )
    127. local hitmanbonustime = 30000
    128. vioGetElementData ( player, "contract", 0 )
    129. local HitmanFamkasse = tonumber(MySQL_GetString("fraktionen", "DepotGeld", "Name LIKE 'Mafia'"))
    130. local HitmanFamkasseNew = HitmanFamkasse + contract
    131. MySQL_SetString("fraktionen", "DepotGeld", CamorraFamkasseNew, "Name LIKE 'Mafia'")
    132. --vioGetElementData ( killer, "money", tonumber ( vioGetElementData ( killer, "money" ) ) + contract )
    133. -- givePlayerMoney ( killer, contract )
    134. triggerClientEvent ( killer, "HudEinblendenMoney", getRootElement() )
    135. playSoundFrontEnd ( killer, 40 )
    136. outputChatBox ( "Du wurdest Opfer eines Auftragmordes! Es waren "..contract.."$ Kopfgeld ausgesetzt!", player, 200, 0, 0 )
    137. outputChatBox ( "Ziel erledigt. Belohnung: "..contract.."$.", killer, 0, 200, 0 )
    138. outputLog ( "[HITMAN]: "..getPlayerName ( killer ).." hat "..getPlayerName(player).." erledigt! Belohnung: "..contract.."$", "bad" )
    139. end
    140. end
    141. revivetimer[player] = setTimer ( revive, 65000+hitmanbonustime, 1, player )
    142. if vioGetElementData ( source, "isInArea51Mission" ) then
    143. setPlayerOutOfArea51 ( source )
    144. outputChatBox ( "Mission gescheitert!", source, 125, 0, 0 )
    145. end
    146. if killer and killer ~= player and getElementType ( killer ) == "player" then
    147. local kills = tonumber ( vioGetElementData ( killer, "kills" ) )
    148. vioGetElementData ( killer, "kills", kills + 1 )
    149. blackListKillCheck ( player, killer, weapon )
    150. --whiteListKillCheck ( player, killer )
    151. if isOnDuty ( killer ) or isArmy ( killer ) then
    152. if vioGetElementData ( player, "wanteds" ) == 0 then
    153. vioSetElementData ( killer, "boni", vioGetElementData ( killer, "boni" )-wantedprice*3 )
    154. outputChatBox ( "Du hast einen Zivilisten erledigt - dir werden "..(wantedprice*3).." $ bei der naechsten Abrechnung abgezogen!", killer, 125, 0, 0 )
    155. else
    156. local strafe = vioGetElementData ( player, "wanteds" ) * wantedprice
    157. local wanteds = vioGetElementData ( player, "wanteds" )
    158. local time = vioGetElementData ( player, "wanteds" ) * jailtimeperwanted * 1.2
    159. vioSetElementData ( player, "wanteds", 0 )
    160. setPlayerWantedLevel ( player, 0 )
    161. if tonumber(strafe) > vioGetElementData ( player, "money" ) then
    162. takePlayerMoney ( player, vioGetElementData ( player, "money" ) )
    163. triggerClientEvent ( player, "HudEinblendenMoney", getRootElement() )
    164. vioSetElementData ( player, "money", 0 )
    165. else
    166. vioSetElementData ( player, "money", tonumber(vioGetElementData ( player, "money" )) - tonumber(strafe) )
    167. takePlayerMoney ( player, tonumber(strafe) )
    168. triggerClientEvent ( player, "HudEinblendenMoney", getRootElement() )
    169. end
    170. vioSetElementData ( player, "jailtime", time )
    171. vioSetElementData ( player, "bail", 0 )
    172. local grammafix = " ohne Kaution "
    173. outputChatBox ( "Du wurdest von Polizist "..getPlayerName(killer).." erledigt und"..grammafix.."fuer "..strafe.." $ und "..time.." Minuten eingesperrt!", player, 0, 125, 0 )
    174. vioSetElementData ( killer, "boni", vioGetElementData ( killer, "boni" )+wanteds*(wantedprice/3) )
    175. outputChatBox ( "Du hast "..getPlayerName ( player ).." erledigt und erhaelst bei der naechsten Abrechnung "..wanteds*(wantedprice/3).." $ Bonus!", killer, 0, 125, 0 )
    176. end
    177. end
    178. end
    179. if isKeyBound ( player, "mouse3", "up", explodeTerror, player ) then
    180. explodeTerror ( player )
    181. end
    182. vioGetElementData ( player, "isinRob", false )
    183. vioGetElementData ( player, "deaths", vioGetElementData ( player, "deaths" ) + 1 )
    184. setPlayerNametagShowing ( player, true )
    185. if not vioGetElementData ( player, "isInHighNoon" ) then
    186. local curdrogen = vioGetElementData ( player, "drugs" )
    187. local amount = getDropAmount ( curdrogen )
    188. if amount > 0 then
    189. vioSetElementData ( player, "drugs", curdrogen - amount )
    190. local x, y, z = getElementPosition ( player )
    191. pickup = createPickup ( 0, 0, 0, 3, 1210, 1 )
    192. setElementPosition ( pickup, x, y, z )
    193. vioSetElementData ( pickup, "amount", amount )
    194. setElementDimension ( pickup, getElementDimension ( player ) )
    195. setElementInterior ( pickup, getElementInterior ( player ) )
    196. addEventHandler ( "onPickupHit", pickup, drugDropHit )
    197. end
    198. --[[local curmats = vioGetElementData ( player, "mats" )
    199. if curmats > 0 then
    200. local amount = getDropAmount ( curmats, player )
    201. vioGetElementData ( player, "mats", curmats - amount )
    202. local x, y, z = getElementPosition ( player )
    203. pickup = createPickup ( 0, 0, 0, 3, 2358, 1 )
    204. setElementPosition ( pickup, x + 0.5, y, z )
    205. vioGetElementData ( pickup, "amount", amount )
    206. setElementDimension ( pickup, getElementDimension ( player ) )
    207. setElementInterior ( pickup, getElementInterior ( player ) )
    208. addEventHandler ( "onPickupHit", pickup, matDropHit )
    209. end]]
    210. --[[local money = vioGetElementData ( player, "money" )
    211. loss = 5
    212. if money > 0 then
    213. vioGetElementData ( player, "money", math.abs(math.floor(money/100*(100-loss))) )
    214. takePlayerMoney ( player, math.floor(money/100*loss) )
    215. local x, y, z = getElementPosition ( player )
    216. pickup = createPickup ( 0, 0, 0, 3, 1212, 1 )
    217. setElementPosition ( pickup, x, y + 0.5, z )
    218. vioGetElementData ( pickup, "money", math.floor(money/100*loss) )
    219. setElementDimension ( pickup, getElementDimension ( player ) )
    220. setElementInterior ( pickup, getElementInterior ( player ) )
    221. addEventHandler ( "onPickupHit", pickup, moneyDropHit )
    222. end]]
    223. end
    224. setElementDimension ( player, 0 )
    225. setElementInterior ( player, 0 )
    226. else
    227. vioGetElementData ( player, "isInHighNoon", false )
    228. setTimer ( savespawn, 5000, 1, player, -2617.2189941406, 212, 4.4970808029175, 0, 0, 0, true )
    229. end
    230. end
    231. showChat ( player, true )
    232. showPlayerHudComponent ( player, "radar", true )
    233. setElementData( player, "gotMerchandise", false )
    234. setElementData( player, "merchandiseAmmount", 0 )
    235. vioGetElementData (player, "wasted", true)
    236. --triggerClientEvent ( player, "showProgressBar", player )
    237. setTimer(function()
    238. if(isElement(m_pick[player])) then
    239. setElementVisibleTo ( m_blip[player], getRootElement(), false )
    240. setElementVisibleTo ( m_mark[player], getRootElement(), false )
    241. setElementVisibleTo ( m_pick[player], getRootElement(), false )
    242. destroyElement(m_pick[player])
    243. destroyElement(m_mark[player])
    244. destroyElement(m_blip[player])
    245. end
    246. end, 60000, 1)
    247. -- MEDIC --
    248. local thePlayer = player
    249. if(isElement(m_pick[thePlayer])) then
    250. setElementVisibleTo ( m_blip[thePlayer], getRootElement(), false )
    251. setElementVisibleTo ( m_mark[thePlayer], getRootElement(), false )
    252. setElementVisibleTo ( m_pick[thePlayer], getRootElement(), false )
    253. destroyElement(m_pick[thePlayer])
    254. destroyElement(m_mark[thePlayer])
    255. destroyElement(m_blip[thePlayer])
    256. end
    257. local x, y, z = getElementPosition(thePlayer)
    258. m_pick[thePlayer] = createPickup(x, y, z, 3, 1254, 1000)
    259. m_mark[thePlayer] = createMarker(x, y, z, "corona", 1.0, 0, 0, 0, 0)
    260. m_blip[thePlayer] = createBlip (x, y, z, 0, 2, 255, 0, 0, getRootElement() )
    261. setElementVisibleTo ( m_blip[thePlayer], getRootElement(), false )
    262. setElementVisibleTo ( m_mark[thePlayer], getRootElement(), false )
    263. setElementVisibleTo ( m_pick[thePlayer], getRootElement(), false )
    264. setElementData(m_mark[thePlayer], "player", thePlayer)
    265. for index, medic in pairs(getElementsByType("player")) do
    266. if(isMedic(medic)) and (isMedicDuty(medic)) then
    267. setElementVisibleTo ( m_blip[thePlayer], medic, true )
    268. setElementVisibleTo ( m_mark[thePlayer], medic, true )
    269. setElementVisibleTo ( m_pick[thePlayer], medic, true )
    270. outputChatBox("FUNKSPRUCH: Toter in "..getZoneName(x, y, z, false)..", "..getZoneName(x, y, z, true).." gemeldet.", medic, 0, 255, 150)
    271. --triggerClientEvent(thePlayer, "onLAMedicToterMeld", thePlayer, thePlayer)
    272. --addEventHandler ( "onPlayerSpawn", thePlayer, medicdeleteBlip_func )
    273. --addEventHandler ( "onPlayerQuit", thePlayer, medicdeleteBlip_func )
    274. end
    275. end
    276. addEventHandler("onMarkerHit", m_mark[thePlayer], function(hitElement)
    277. if(thePlayer == hitElement) or (isPedDead(hitElement)) then return end
    278. if(getElementType(hitElement) == "player") and (isMedic(hitElement) == true) and (isMedicDuty(hitElement)) then
    279. local thePlayer = getElementData(source, "player")
    280. if(isElement(thePlayer)) then
    281. toggleAllControls(hitElement, false)
    282. setPedAnimation(hitElement, "MEDIC", "CPR", -1, true, false, false)
    283. setTimer(function()
    284. wiederbelebe_player(hitElement, thePlayer)
    285. toggleAllControls(hitElement, true)
    286. setPedAnimation(hitElement)
    287. end, 7500, 1)
    288. end
    289. setElementVisibleTo ( m_blip[thePlayer], getRootElement(), false )
    290. setElementVisibleTo ( m_mark[thePlayer], getRootElement(), false )
    291. setElementVisibleTo ( m_pick[thePlayer], getRootElement(), false )
    292. destroyElement(m_pick[thePlayer])
    293. destroyElement(m_mark[thePlayer])
    294. destroyElement(m_blip[thePlayer])
    295. end
    296. end)
    297. end
    298. addEventHandler ( "onPlayerWasted", getRootElement(), playerdeath )
    Alles anzeigen
  • Neu

    Falls es jemanden interessiert, ich habe die Lösung für dieses Problem gefunden. Ich musste in dem Ordner environment in der death.lua in dem Abschnitt wo die Medicfunktion hinkommt bei der createBlip das getRootElement() entfernen. Danach hat es geklappt.

    LUA-Quellcode: Alt

    1. m_blip[thePlayer] = createBlip (x, y, z, 0, 2, 255, 0, 0, getRootElement() )

    LUA-Quellcode: Neu

    1. m_blip[thePlayer] = createBlip (x, y, z, 0, 2, 255, 0, 0 )