Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- INDICATOR bei MULTI! --
- -- HOLY FUCK, DO NOT COPY! --
- local blink = {}
- local blinkTimer = {}
- local bVar = {}
- local markerPositions = {}
- local bcVar = {}
- markerPositions[411] = { {-1, 2.5, -0.2}, {-1, -2.3, 0}, {1, 2.5, -0.2}, {1, -2.3, 0} }
- function reenableBlinker(thePlayer)
- if(bVar[thePlayer] == 0) then
- bVar[thePlayer] = 1
- for index, mark in pairs(blink[thePlayer]) do
- setElementAlpha(mark, 0)
- end
- else
- bVar[thePlayer] = 0
- local r, g, b = 255, 255, 255
- if(bcVar[thePlayer] == 0) then
- r, g, b = 0, 255, 255
- bcVar[thePlayer] = 1
- elseif(bcVar[thePlayer] == 1) then
- r, g, b = 0, 255, 0
- bcVar[thePlayer] = 2
- elseif(bcVar[thePlayer] == 2) then
- r, g, b = 0, 0, 255
- bcVar[thePlayer] = 3
- elseif(bcVar[thePlayer] == 3) then
- r, g, b = 255, 150, 0
- bcVar[thePlayer] = 4
- elseif(bcVar[thePlayer] == 4) then
- r, g, b = 255, 0, 0
- bcVar[thePlayer] = 5
- elseif(bcVar[thePlayer] == 5) then
- r, g, b = 255, 255, 0
- bcVar[thePlayer] = 6
- elseif(bcVar[thePlayer] == 6) then
- r, g, b = 50, 200, 255
- bcVar[thePlayer] = 7
- elseif(bcVar[thePlayer] == 7) then
- r, g, b = 50, 50, 255
- bcVar[thePlayer] = 0
- else
- r, g, b = 255, 255, 255
- end
- for i = 1, 4, 1 do
- setElementAlpha(blink[thePlayer][i], 255)
- setMarkerColor(blink[thePlayer][i], r, g, b, 255)
- end
- end
- end
- addEventHandler("onVehicleExplode", getRootElement(),
- function()
- local data = getElementData(source, "v.stateowner")
- if(data) then
- if(getElementData(data, "b.state") == true) then
- killTimer(blinkTimer[data])
- for i = 1, 4, 1 do
- local mark = getElementData(source, "v.state"..i)
- destroyElement(mark)
- end
- bVar[data] = 0
- bcVar[data] = 0
- setElementData(data, "b.state", false)
- end
- end
- end)
- addEventHandler("onElementDestroy", getRootElement(),
- function()
- if(getElementType(source) == "vehicle") then
- local data = getElementData(source, "v.stateowner")
- if(data) then
- if(getElementData(data, "b.state") == true) then
- killTimer(blinkTimer[data])
- for i = 1, 4, 1 do
- local mark = getElementData(source, "v.state"..i)
- destroyElement(mark)
- end
- bVar[data] = 0
- bcVar[data] = 0
- setElementData(data, "b.state", false)
- end
- end
- end
- end)
- local persons = {
- ["MuLTi"] = true,
- ["[XP]Viperbrawl"] = true,
- ["[XP]Sk_Styla"] = true,
- ["#LarSo~"] = true,
- ["[XP]InTrOBaSs"] = true,
- ["[XP]xReket"] = true
- }
- addCommandHandler("blink",
- function(thePlayer)
- if(isPedInVehicle(thePlayer) == false) then return end
- if(persons[getPlayerName(thePlayer)] == true) then else outputChatBox("Du bist nicht Befugt!", thePlayer, 200, 0, 0 false) return end
- if(getElementData(thePlayer, "b.state") == true) then
- setElementData(thePlayer, "b.state", false)
- outputChatBox("Blinker Ausgeschaltet.", thePlayer, 0, 200, 0, false)
- for i = 1, 4, 1 do
- destroyElement(blink[thePlayer][i])
- end
- killTimer(blinkTimer[thePlayer])
- bVar[thePlayer] = 0
- bcVar[thePlayer] = 0
- else
- local veh = getPedOccupiedVehicle(thePlayer)
- setElementData(thePlayer, "b.state", true)
- outputChatBox("Blinker Angeschaltet.", thePlayer, 0, 200, 0, false)
- blink[thePlayer] = {}
- blink[thePlayer][1] = createMarker(0, 0, 0, "corona", 0.3, 0 , 255, 255)
- blink[thePlayer][2] = createMarker(0, 0, 0, "corona", 0.3, 0 , 255, 255)
- blink[thePlayer][3] = createMarker(0, 0, 0, "corona", 0.3, 0 , 255, 255)
- blink[thePlayer][4] = createMarker(0, 0, 0, "corona", 0.3, 0 , 255, 255)
- for i = 1, 4, 1 do
- setElementData(veh, "v.state"..i, blink[thePlayer][i])
- end
- setElementData(veh, "v.stateowner", thePlayer)
- local model = getElementModel(veh)
- attachElements(blink[thePlayer][1], veh, markerPositions[model][1][1], markerPositions[model][1][2], markerPositions[model][1][3])
- attachElements(blink[thePlayer][2], veh, markerPositions[model][2][1], markerPositions[model][2][2], markerPositions[model][2][3])
- attachElements(blink[thePlayer][3], veh, markerPositions[model][3][1], markerPositions[model][3][2], markerPositions[model][3][3])
- attachElements(blink[thePlayer][4], veh, markerPositions[model][4][1], markerPositions[model][4][2], markerPositions[model][4][3])
- bVar[thePlayer] = 0
- bcVar[thePlayer] = 0
- blinkTimer[thePlayer] = setTimer(reenableBlinker, 450, 0, thePlayer)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment