Jump to content

Dimos7

Members
  • Posts

    1,546
  • Joined

  • Last visited

Everything posted by Dimos7

  1. Dimos7

    [HELP]

    Post your full code here
  2. function onDeath() setTimer(spawnPlayer, 2000, 1, source, x, y, z) addEventHandler("onPlayerWasted", root, onDeath) x, y, z will be there you want to spawn
  3. local r. = getRealTime() r.timestamp local timestring = ("%02d-%02d- %04d %02d-%02d-%02d):format( r.timestamp)
  4. Dimos7

    Window to Dx

    that i think it images if you say login panel etc
  5. Dimos7

    destroyElement

    function onEnter() local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 593 then toggleControl ( "brake_reverse", true ) triggerServerEvent ( "createMG_s", localPlayer, veh ) end end addEventHandler("onClientVehicleEnter", getRootElement(), onEnter) function createMG(veh) if not isElement(mg) then local x,y,z = getElementPosition(veh) local mg = createWeapon("m4", x,y,z+3) local mg2 = createWeapon("m4", x,y,z+3) outputChatBox("createMG",255,255,215) setWeaponFiringRate(mg, 20) setWeaponFiringRate(mg2, 20) setWeaponClipAmmo(mg, 99999) setWeaponClipAmmo(mg2, 99999) setWeaponState(mg, "ready") setWeaponState(mg2, "ready") attachElements(mg, veh, 2,0.7,-0.5,0,2,90) --right side & - = right direction attachElements(mg2, veh, -1.9,0.7,-0.5,0,2,90) setElementData(localPlayer,"mg",mg) end end addEvent( "createMG_c", true ) addEventHandler( "createMG_c", localPlayer, createMG ) function onExit() local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 593 then local Mg = getElementData(localPlayer,"mg",mg) local Mg2 = getElementData(localPlayer,"mg2",mg2) triggerServerEvent ( "destroyMG_s", resourceRoot, mg,mg2 ) end end addEventHandler("onClientVehicleStartExit", getRootElement(), onExit) function destroyMG(mg,mg2) destroyElement(mg) destroyElement(mg2) end addEvent( "destroyMG_c", true ) addEventHandler( "destroyMG_c", localPlayer, destroyMG )
  6. function Blip() for _, v in ipairs(getElementsByType("player")) do local r, g, b = getTeamColor(getPlayerTeam(v)) createBlipAttachedTo(v, 0, 2, r, g, b) end end setTimer(Blip, 5000, 0) function quit() destoryBlipsAttachedTo(souce) end addEventHandler("onPlayerQuit", root, quit) function destoryBlipsAttachedTo(thePlayer) local attached = getAttachedElements(thePlayer) if (attached) then for k, element in ipairs(attached) do if getElementType(element)== "blip" then destroyElement(element) end end end end
  7. Dimos7

    Help me

    anyone knows why?
  8. Dimos7

    [Help]Police

    first change name to arrest_s.lua all is .lua not slua
  9. Dimos7

    help

    marker = createMarker (177.48828125, 1453.826171875, 10.591223716736,"cylinder",1.5,255,0,111,255) function teleport (hitElement) local accName = getAccountName ( getPlayerAccount (player) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then setElementPosition (hitElement,182.4287109375, 1451.6865234375, 33.012893676758) else outputChatBox ("# off!You are not admin.") end addEventHandler ("onMarkerHit",marker,teleport)
  10. Dimos7

    Help me

    function getPlayerFromPatrialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end function privateMessage(thePlayer, _, sendToName, ...) local message = table.concat({...}, "") if sendToName then if (getPlayerFromPatrialName(sendToName)) then toPlayer = getPlayerFromPatrialName(sendToName) if toPlayer ~= thePlayer then if message ~= "" then outputChatBox("#18CB5BPM to "..getPlayerName(toPlayer)..":#FFFFFF "..message, thePlayer, 255, 255, 255, true) outputChatBox("#18CB5BPM from "..getPlayerName(thePlayer)..":#FFFFFF "..message, toPlayer, 255, 255, 255, true) outputServerLog("#18CB5BPM to "..getPlayerName(toPlayer)..":#FFFFFF "..message) outputServerLog("#18CB5BPM from "..getPlayerName(thePlayer).."#FFFFFF "..message) outputChatBox("#18CB5B /reply [message]", toPlayer, 255, 255, 255, true) setElementData(thePlayer, "pmPartner", toPlayer) setElementData(toPlayer, "pmPartner", thePlayer) else outputChatBox("Use /pm [part of name] [message]", thePlayer, 255, 0, 0) return false end else outputChatBox("You cannot pm to yourself!", thePlayer, 255, 0, 0) return false end else outputChatBox("Player not found!", thePlayer, 255, 0, 0) return false end else outputChatBox("Use /pm [part of name] [message]", thePlayer, 255, 0, 0) return false end end addCommandHandler("pm", privateMessage) function privateMessageReply(thePlayer, _, ...) local message = table.concat({...}, "") local toPlayer = getElementData(thePlayer, "pmPartner") if toPlayer then if message ~= "" then outputChatBox("#18CB5BPM to "..getPlayerName(toPlayer)..":#FFFFFF "..message, thePlayer, 255, 255, 255, true) outputChatBox("#18CB5BPM from "..getPlayerName(thePlayer)..":#FFFFFF "..message, toPlayer, 255, 255, 255, true) outputServerLog("#18CB5BPM to "..getPlayerName(toPlayer)..":#FFFFFF "..message) outputServerLog("#18CB5BPM from "..getPlayerName(thePlayer)..":#FFFFFF "..message) outputChatBox("#18CB5B /reply [message]", toPlayer, 255, 255, 255, true) else outputChatBox("Use /reply [message]", thePlayer, 255, 0, 0) return false end else outputChatBox("None is pmming you!", thePlayer, 255, 0, 0) return false end end addCommandHandler("reply", privateMessageReply) i press space for a message and send it without space why?
  11. gLPlayer = getLocalPlayer() addEvent("onClientPlayerFireRocket", false) function fireRocketByRotation(startX, startY, startZ, rotX, rotZ, velocity) local nrotX = -rotX local nrotZ = -(rotZ + 180) local velZ = velocity * math.sin(math.rad(rotX)) local a = velocity * math.cos(math.rad(rotX)) local velX = a * math.sin(math.rad(-rotZ)) local velY = a * math.cos(math.rad(-rotZ)) createProjectile(gLPlayer, 19, startX, startY, startZ, 1.0, nil, nrotX, 0, nrotZ, velX / 50, velY / 50, velZ / 50) triggerEvent("onClientPlayerFireRocket", gLPlayer) end function fireRocketByTargetPosition(startX, startY, startZ, targetX, targetY, targetZ, velocity) local rotZ = getRotationZ(startX, startY, targetX, targetY) local rotX = getRotationX(startX, startY, startZ, targetX, targetY, targetZ) fireRocketByRotation(startX, startY, startZ, rotX, rotZ, velocity) end function getRotationZ(startX, startY, endX, endY) -- Dommed-Space-Marine local height = endX - startX local line = endY - startY local t = -math.deg(math.atan2(height, line)) if t < 0 then t = t + 360 end return t end function getRotationX(startX, startY, startZ, endX, endY, endZ) -- Dommed-Space-Marine local line = ((endX - startX) ^ 2 + (endY - startY) ^ 2) ^ 0.5 local height = endZ - startZ local t = math.deg(math.atan2(height, line)) --[[ if t < 0 then t = t + 360 end --]] return t end function rocket() local x,y,z = getElementPosition(gLPlayer) local rx, _, rz = getPedCameraRotation(gLPlayer) fireRocketByRotation(x,y,z,rx,rz, 50) end bindKey("mouse1", "down", rocket)
  12. gLPlayer = getLocalPlayer() addEvent("onClientPlayerFireRocket", false) function fireRocketByRotation(startX, startY, startZ, rotX, rotZ, velocity) local nrotX = -rotX local nrotZ = -(rotZ + 180) local velZ = velocity * math.sin(math.rad(rotX)) local a = velocity * math.cos(math.rad(rotX)) local velX = a * math.sin(math.rad(-rotZ)) local velY = a * math.cos(math.rad(-rotZ)) createProjectile(gLPlayer, 19, startX, startY, startZ, 1.0, nil, nrotX, 0, nrotZ, velX / 50, velY / 50, velZ / 50) triggerEvent("onClientPlayerFireRocket", gLPlayer) end function fireRocketByTargetPosition(startX, startY, startZ, targetX, targetY, targetZ, velocity) local rotZ = getRotationZ(startX, startY, targetX, targetY) local rotX = getRotationX(startX, startY, startZ, targetX, targetY, targetZ) fireRocketByRotation(startX, startY, startZ, rotX, rotZ, velocity) end function getRotationZ(startX, startY, endX, endY) -- Dommed-Space-Marine local height = endX - startX local line = endY - startY local t = -math.deg(math.atan2(height, line)) if t < 0 then t = t + 360 end return t end function getRotationX(startX, startY, startZ, endX, endY, endZ) -- Dommed-Space-Marine local line = ((endX - startX) ^ 2 + (endY - startY) ^ 2) ^ 0.5 local height = endZ - startZ local t = math.deg(math.atan2(height, line)) --[[ if t < 0 then t = t + 360 end --]] return t end function rocket() local x,y,z = getElementPosition(gLPlayer) local rx,ry, rz = getPedCameraRotation(gLPlayer) fireRocketByRotation(x,y,z,rx,ry,rz 50) end end bindKey("mouse1", "down", rocket)
  13. setTimer( function() for _, v in ipairs(getElementsByType("player")) do if getPlayerPing(v) >= 300 then kickPlayer(v, "Ping over 300") outputChatBox(getPlayerName(v) " has been kicked by console for high ping.", root, 255, 0 ,0) end end end, 5000, 0)
  14. --Server Side function m4(thePlayer) giveWeapon(thePlayer, 31, 50, true) end addEvent("m4", true) addEventHandler("m4", root, m4) --Client Side m4 = exports.dxgui:dxCreateButton(167, 65, 113, 26, "M4" window) function m4p() triggerServerEvent("m4", localPlayer) end addEventHandler("onClientDXClick", m4, m4p)
  15. --Server Side function fbiscript(thePlayer) local x, y, z = getElementPosition(thePlayer) rancher = createVehicle(490, x, y, z+2) end addEvent("fbi", true) addEventHandler("fbi", root, fbiscript) --Client Side function fbirancherp() triggerServerEvent("fbi", localPlayer) end addEventHandler("onClientDxClick", fbirancher, fbirancherp)
  16. local maxzombies = 30 local zombiecount = 0 zombie = {} function spawn() local x,y,z = getElementPosition (localPlayer) zombie[tostring(zombiecount)] = zombiecount local zombie[zombiecount] = createPed (20,x+math.random(-7,7),y+math.random(-7,7),z) end function follow() zpx,zpy,zpz = getElementPosition (zombie[zombiecount]) local zombie_angle = (360 - math.deg(math.atan2((zpx - x), (zpy - y)))) % 360 local dist = getDistanceBetweenPoints2D(x, y, zpx, zpy) if (dist > 2) then setPedCameraRotation (zombie[zombiecount],zombie_angle) setPedControlState(zombie[zombiecount], "forwards", true) elseif (dist < 2) then setPedControlState(zombie[zombiecount], "forwards", false) setPedControlState(zombie[zombiecount], "fire", true) end end setTimer (follow, 1000, 0) function zombie_check() if (zombiecount < maxzombies) then spawn() zombiecount = zombiecount + 1 end end setTimer (zombie_check, 100, 0) function zombie_died() zombiecount = zombiecount - 1 end addEventHandler("onClientPedWasted", getRootElement(), zombie_died)
  17. Dimos7

    Oxygen

    then explane better please
  18. Dimos7

    Oxygen

    yes i notice it now ty
  19. Dimos7

    Oxygen

    LoadOxygen = createPickup(-1890.1999511719, 2145.1000976563, 1.7999999523163, 3, 2690, 2000) setTimer(function() for k, v in ipairs (getElementsByType("player")) do if getElementModel(v) ~= 97 or not isElementInWater(v) then return end local oxygen = getPedOxygenLevel(v) if isElementInWater(v) then setPedOxygenLevel(v, oxygen-1) end end end, 400000, 0) addEventHandler("onClientPickupHit", LoadOxygen, function(element) for k, v in ipairs(getElementsByType("player")) do if getElementModel(v) ~= 97 and not isElementInWater(v) then return end if element ~= localPlayer then return end setPedOxygenLevel(v, 100) end end )
  20. any debug warning or error? in meta that file need by type="client"
  21. addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientGUIClick", SoyguncuButon, Soygun, false) end) function Soygun() if not getPedWeapon(localPlayer) then givePedWeapon(localPlayer,31,200,true) end end
  22. addEventHandler("onPlayerWasted", root, function() local theVehicle = getPedOccupiedVehicle(source) if isVehicleBlown(theVehicle) then local creator = getPlayerName(source) local x, y, ,z = getElementPosition(source) createObject(1212, x, y, z+0.5) triggerClientEvent(srouce, "play", source) end end)
  23. local Sprinting = nil function antiBunnyHopping() local moveState = getPedMoveState(localPlayer) if moveState == "sprint" then Sprinting = true elseif Sprinting == true and moveState == "jump" then setPedAnimation(localPlayer, "ped", "FALL_front") end Sprinting = false setPedAnimation(localPlayer, false) end addEventHandler("onClientPreRender", root, antiBunnyHopping)
×
×
  • Create New...