Jump to content

Plean

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by Plean

  1. From wiki page: If the cursor isn't showing, returns false as the first value.
  2. local markerPositions = { {780.79998779297, -1319.5999755859, 13.39999961853}, {835.09997558594, -1322.1999511719, 13.39999961853}, {942.09997558594, -1287.5, 14.5}, {830, -1145.5, 23.700000762939}, {692.20001220703, -1223.9000244141, 16.5}, {665, -1308.4000244141, 13.5}, {769.40002441406, -1387.6999511719, 13.60000038147} } function TaksiFunc() local TaksiTeam = createTeam("Taksici", 255, 255, 0 ) setPlayerTeam(source, TaksiTeam) setElementDimension(source, 120) setElementModel(source, 7) local taxi = createVehicle(420, 776.20001220703, -1339.5999755859, 13.39999961853 ) setElementDimension(taxi, 120) warpPedIntoVehicle(source, taxi) setElementData(source, 'currentMarker', 1) local x, y, z = unpack(markerPositions[1]) local marker = createMarker(x, y, z, "checkpoint", 2, 255, 0, 0, 255) setElementDimension(marker, 120) setElementVisibleTo(marker, root, false) setElementVisibleTo(marker, source, true) addEventHandler("onMarkerHit", marker, taxiMarkerHit) end addEvent("TaksiSkin", true) addEventHandler("TaksiSkin", root, TaksiFunc) function taxiMarkerHit(hitElement, matchingDimension) if matchingDimension then if isElementVisibleTo(source, hitElement) then local currentMarker = getElementData(hitElement, 'currentMarker') + 1 if currentMarker <= #markerPositions then setElementPosition(source, unpack(markerPositions[currentMarker])) setElementData(hitElement, 'currentMarker', currentMarker) else local taxi = getPedOccupiedVehicle(hitElement) removePedFromVehicle(hitElement, taxi) destroyElement(taxi) outputChatBox("Taksi Job'u bitirdin! Magasin : #FFFF00 25000 TL ", hitElement, 255, 69, 0, true) setElementDimension(hitElement, 0) setElementPosition(hitElement, 769.40002441406, -1387.6999511719, 13.60000038147) setPlayerTeam(hitElement, nil) setElementData(hitElement, 'currentMarker', false) givePlayerMoney(hitElement, 25000) removeEventHandler("onMarkerHit", source, taxiMarkerHit) destroyElement(source) end end end end
  3. Why do you destroy the markers? You could use only one marker and if element hits it just set it to another position.
  4. Nearly all gui element creation functions (guiCreateButton, guiCreateLabel, etc) have "parent" argument. If you set that to window, then you don't need to set the positions of the lables, buttons, etc again.
  5. Are you using this? If yes then callServerFunction("createVehicle", ...) doesn't return a vehicle.
  6. local vehicle = createVehicle(506, 2100.2697, 1397.4947, 10.3, 0, 0, 0) setElementData(vehicle, "HLS", {"SWAT HQ", "SWAT Member"}) addEventHandler("onVehicleStartEnter", root, function(thePlayer, seat, jacked, door) local vehicleOwners = getElementData(source, "HLS") local gangGroup = getElementData(thePlayer, "HLS") if (not vehicleOwners) then return end local canUseVehicle = false for i = 1, #vehicleOwners do if gangGroup == vehicleOwners[i] then canUseVehicle = true end end if not canUseVehicle then outputChatBox("This car is locked and belongs to the following class: Admins", thePlayer, 245, 20, 20, false) cancelEvent() end end )
  7. In line 2 and 4 replace the last "m" of "d-m-Y-h-m" with "i".
  8. Line 10 and 19 you have getPlayerAccount(pla). It should be thePlayer not pla?
  9. In dxDrawImage there is argument named "color". There you can write "tocolor(255, 255, 255, alpha)" to change image alpha
  10. The "source" is player, who stealth killed ped/player.
  11. Plean

    Admin chatbox

    Better way to do it is inserting players, who are admins or moderators, into a table when they log in and removing them when they log out. So you don't have to loop through aclGroupListObjects every time some admin or moderator uses this command.
  12. function onStealthKill(target) outputChatBox("Stealth kill!", source) end addEventHandler("onPlayerStealthKill", getRootElement(), onStealthKill)
  13. object = createObject(980, 2754, 1312, 13, 0, 0, 90) marker = createMarker(2754, 1312,12, "cylinder", 2, 100, 0, 0, 100) function gateo ( hitElement ) if getElementType( hitElement ) == "player" then local team = getPlayerTeam ( hitElement ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == "Assassins" ) then moveObject ( object, 2000, 2754, 1312, 8 ) end end end addEventHandler ( "onMarkerHit", marker , gateo ) function gatec ( leftElement ) moveObject ( object, 2000, 2754, 1312, 13 ) end addEventHandler ( "onMarkerLeave", marker , gatec )
  14. function isAnyGuiWindowVisible() for k, v in ipairs(getElementsByType("gui-window")) do if guiGetVisible(v) then return true end end return false end function worldObject(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if getElementType(clickedElement) == "player" then if not isAnyGuiWindowVisible() then triggerEvent("showTheWindow", localPlayer, clickedElement) end end end addEventHandler("onClientClick", getRootElement(), worldObject)
  15. function worldObject(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement) if getElementType(clickedElement) == "player" then triggerEvent("showTheWindow", localPlayer, clickedElement) end end addEventHandler("onClientClick", getRootElement(), worldObject)
  16. Plean

    Oxygen Bar

    Try mine again, but first remove your old one. Maybe your bugged oxygen bar was covering other's bars.
  17. local shaderwater = xmlNodeGetAttribute(xmlFile,"shaderwater") == "true" and true or false This should convert strings to booleans.
  18. Plean

    Oxygen Bar

    addEventHandler('onClientRender', root, function () local oxygenLevel = math.ceil(getPedOxygenLevel(getLocalPlayer())) local maxOxygenLevel = 1000 + 1.5 * getPedStat(getLocalPlayer(), 225) if oxygenLevel < maxOxygenLevel or isElementInWater(getLocalPlayer()) then dxDrawRectangle(900, 94, 266, 20, tocolor(0, 0, 0, 255), true) dxDrawRectangle(901, 95, math.floor(264 / maxOxygenLevel * oxygenLevel), 18, tocolor(8, 154, 246, 255), true) end end )
×
×
  • Create New...