Jump to content

Skarbonke

Members
  • Posts

    57
  • Joined

  • Last visited

About Skarbonke

  • Birthday 05/04/2000

Details

  • Gang
    My Tactical Team
  • Location
    Lithuania
  • Occupation
    FreeRoam
  • Interests
    BLACKROOM-English Freeroam

Recent Profile Visitors

1,367 profile views

Skarbonke's Achievements

Snitch

Snitch (10/54)

7

Reputation

  1. Thank you, it worked! <3
  2. function addKeyInBlinkers() if (not isKeyBound(player, ",")) and (not isKeyBound(player, ".")) then bindKey(player,",", "down", "lleft") bindKey(player,".", "down", "lright") bindKey(player,"/", "down", "warn") end end addEventHandler("onResourceStart", resourceRoot, addKeyInBlinkers) The Loop through all players part I really really don't get...
  3. thank you for the replay, but it doesn't work or I do something wrong ;/
  4. Hey guys! Skarbonke here, need some help on binding this "blinker" script on a <,> and / idk why it isin't working, please help. It should work when you press the button, and when you press it again it stops blinking. -- Global data and pointers toggler = { } dtype = { } syncTimer = { } currHeadLightColor = {{ }} function isVehicleBlinking( vehicle) if currHeadLightColor[vehicle] then return true else return false end end -- Toggling lights function toggleLights( veh ) if isElement( veh ) then setVehicleOverrideLights( veh, 2 ) if toggler[veh] == 1 then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 1 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 1 ) end toggler[veh] = 0 else if dtype[veh] == "lleft" then setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 0 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 0 ) end elseif dtype[veh] == "lright" then setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 1 ) if (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 1 ) end elseif (getElementType(veh) == "vehicle") and dtype[veh] == "warn" then setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 0 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 0 ) end end toggler[veh] = 1 end end end -- Left function lightHandler( player, cmd ) if player and isElement( player ) and getPedOccupiedVehicle( player ) then local veh = getPedOccupiedVehicle( player ) if ( not isTimer( syncTimer[veh] ) or cmd ~= dtype[veh] ) and getVehicleOccupants(veh)[0] == player then -- Save the current head light color setVehicleLightState( veh, 0, 1 ) setVehicleLightState( veh, 1, 1 ) setVehicleLightState( veh, 2, 1 ) setVehicleLightState( veh, 3, 1 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 1 ) setVehicleLightState( veh2, 1, 1 ) setVehicleLightState( veh2, 2, 1 ) setVehicleLightState( veh2, 3, 1 ) end if not currHeadLightColor[veh] then currHeadLightColor[veh] = { } currHeadLightColor[veh][1],currHeadLightColor[veh][2],currHeadLightColor[veh][3] = getVehicleHeadLightColor( veh ) end -- Set the new headlight color to yellow setVehicleHeadLightColor( veh, 255, 200, 0 ) -- Start the syn timer if isTimer( syncTimer[veh] ) then killTimer( syncTimer[veh] ) end syncTimer[veh] = setTimer( toggleLights, 380, 0, veh ) toggler[veh] = 1 dtype[veh] = cmd toggleLights( veh ) else if isTimer( syncTimer[veh] ) then killTimer( syncTimer[veh] ) local vehID = getElementData( veh, "vehicleID") if vehID then local vehID = tonumber( vehID) local colorTable = exports.GTIvehicles:getVehicleData( vehID, "light_color") or "255,255,255" local cData = split( colorTable, ",") --setVehicleHeadLightColor( veh, currHeadLightColor[veh][1],currHeadLightColor[veh][2],currHeadLightColor[veh][3] ) setVehicleHeadLightColor( veh, cData[1], cData[2], cData[3]) currHeadLightColor[veh] = nil else setVehicleHeadLightColor( veh, 255, 255, 255) end end setVehicleLightState( veh, 0, 0 ) setVehicleLightState( veh, 1, 0 ) setVehicleLightState( veh, 2, 0 ) setVehicleLightState( veh, 3, 0 ) setVehicleOverrideLights( veh, 2 ) if veh and isElement(veh) and (getElementType(veh) == "vehicle") and getVehicleTowedByVehicle( veh ) then local veh2 = getVehicleTowedByVehicle( veh ) setVehicleLightState( veh2, 0, 0 ) setVehicleLightState( veh2, 1, 0 ) setVehicleLightState( veh2, 2, 0 ) setVehicleLightState( veh2, 3, 0 ) setVehicleOverrideLights( veh2, 2 ) end end end end addCommandHandler( "lleft", lightHandler ) addCommandHandler( "lright", lightHandler ) addCommandHandler( "warn", lightHandler ) function addKeyInBlinkers() if (not isKeyBound(source, ",")) and (not isKeyBound(source, ".")) then bindKey(",", "down", "lleft") bindKey(".", "down", "lright") bindKey("/", "down", "warn") end end addEventHandler("onResourceStart", resourceRoot, addKeyInBlinkers)
  5. Yeah, you should do it, I really really like it, but the fact when u mark it it's green I think that's some bull:~, you should just put a marker just to see it, cuz now u just can't really get the real colors of the object ;x
  6. local vehicleBlipRoot = createElement("vehicleBlipRoot", "vehicleBlipRoot") --This function creates a blip for all currently streamed-in vehicles when the resource starts. local function resourceStart() for _, vehicle in ipairs(getElementsByType("vehicle"), root, true) do if vehicle ~= getPedOccupiedVehicle(localPlayer) then local blip = createBlipAttachedTo(vehicle, 0, 1, 150, 150, 150, 255, -10, 100) setElementParent(blip, vehicleBlipRoot) end end end addEventHandler("onClientResourceStart", root, resourceStart) --This function destroys a vehicle's blip when it streams out. local function streamOut() for _, blip in ipairs(getElementChildren(vehicleBlipRoot)) do if getElementAttachedTo(blip) == source then destroyElement(blip) end end removeEventHandler("onClientElementStreamOut", source, streamOut) removeEventHandler("onClientElementDestroy", source, streamOut) end --This function creates a blip when a vehicle streams in. local function streamIn() if getElementType(source) ~= "vehicle" then return end --Check if the vehicle already has a blip. for _, blip in ipairs(getElementChildren(vehicleBlipRoot)) do if getElementAttachedTo(blip) == source then return end end local blip = createBlipAttachedTo )( element elementToAttachTo [, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 99999.0] ) setElementParent(blip, vehicleBlipRoot) addEventHandler("onClientElementStreamOut", source, streamOut) addEventHandler("onClientElementDestroy", source, streamOut) end addEventHandler("onClientElementStreamIn", root, streamIn) Just can't get it to work
  7. Hello, I want that this resource would show the blips in the minimap, but not in the F11 or just cars that are close, cuz now it's showin all the cars, and it's laggy local vehicleBlipRoot = createElement("vehicleBlipRoot", "vehicleBlipRoot") --This function creates a blip for all currently streamed-in vehicles when the resource starts. local function resourceStart() for _, vehicle in ipairs(getElementsByType("vehicle"), root, true) do if vehicle ~= getPedOccupiedVehicle(localPlayer) then local blip = createBlipAttachedTo(vehicle, 0, 1, 150, 150, 150, 255, -10, 150) setElementParent(blip, vehicleBlipRoot) end end end addEventHandler("onClientResourceStart", root, resourceStart) --This function destroys a vehicle's blip when it streams out. local function streamOut() for _, blip in ipairs(getElementChildren(vehicleBlipRoot)) do if getElementAttachedTo(blip) == source then destroyElement(blip) end end removeEventHandler("onClientElementStreamOut", source, streamOut) removeEventHandler("onClientElementDestroy", source, streamOut) end --This function creates a blip when a vehicle streams in. local function streamIn() if getElementType(source) ~= "vehicle" then return end --Check if the vehicle already has a blip. for _, blip in ipairs(getElementChildren(vehicleBlipRoot)) do if getElementAttachedTo(blip) == source then return end end local blip = createBlipAttachedTo(source, 0, 1, 150, 150, 150, 255, -10, 150) setElementParent(blip, vehicleBlipRoot) addEventHandler("onClientElementStreamOut", source, streamOut) addEventHandler("onClientElementDestroy", source, streamOut) end addEventHandler("onClientElementStreamIn", root, streamIn)
  8. Thank u, it worked :3
  9. addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then if then ( getPlayerWeapon(attacker) == 24 )² setElementHealth(source -50) end end end ) I get an error that says:5: unexpected symbol near "then" , and i can't get it right
  10. I don't need 1 shot kill
  11. local BodyPart = Head if bodypart == BodyPart then if ( getPlayerWeapon(theAttacker) == 24 ) then setElementHealth(theVectim, 50 ) end end That gave me an error: 3: Bad argument "getPlayerWeapon"[expected ped at argument 1, got nil]
  12. So hey there, it's me again :D, how to make a guns (ex. deagle, sniper) damage, like if you hit the head you do 50 damage, if you hit in the legs you do 20 damage, chest 30 damage, arms 10 damage ?
  13. So hey, I need help with cars, that respawned and got random colors, I just got the respawned part, but I can't get the random color to work, it sould get random color on the respawn, but it never get's it
×
×
  • Create New...