Jump to content

KariiiM

Members
  • Posts

    1,312
  • Joined

  • Last visited

Everything posted by KariiiM

  1. KariiiM

    Unbind key

    Why when i shoose a camera point far of my place or closed to me ,after i return the camera with "setCameraTarget" the ped fall under the ground,what's the solution to avoid this problem?
  2. KariiiM

    Unbind key

    Thanks Citizen, that's what i wanted to do exactly
  3. KariiiM

    Unbind key

    Hey guys, i face a small problem in same time a big one, i tried to make a resource for camera system,i want to release it to the community since there's no resource like that, Everything scripted fine,but i got a problem in unbinding a key, the key of returning with setCameraTarget. So, when the player press "accept" the function "bind" will be binded, untill now everything is fine , but when the Camera Points shows, after pressing the key "X", it doesn't be unbinded, so here's the problem. ~Regards. --Part of my code: (this problem is on Client side,server side is fine) addEventHandler ("onClientGUIClick", root, function () if (source == cancel) then guiSetVisible(window,false) showCursor(false) unbindKey("X", "down", bind) elseif (source == accept) then local row,col = guiGridListGetSelectedItem(camGrid) if row and col and row ~= -1 and col ~= -1 then guiSetVisible(window,false) showCursor(true) outputChatBox ("Camera: Press X to stop the camera.",0,255,0) local x = guiGridListGetItemText (camGrid, guiGridListGetSelectedItem (camGrid),3) local y = guiGridListGetItemText (camGrid, guiGridListGetSelectedItem (camGrid),4) local z = guiGridListGetItemText (camGrid, guiGridListGetSelectedItem (camGrid),5) local cx = guiGridListGetItemText (camGrid, guiGridListGetSelectedItem (camGrid),6) local cy = guiGridListGetItemText (camGrid, guiGridListGetSelectedItem (camGrid),7) local cz = guiGridListGetItemText (camGrid, guiGridListGetSelectedItem (camGrid),8) triggerServerEvent("Camera:watch",localPlayer,guiGridListGetSelectedItem(camGrid)+1) bindKey("X", "down", bind) else outputChatBox ("Camera System: You didn't selecte the item.",0,180,23) end end end) function bind(key) if key == "X" then setCameraTarget(localPlayer) showChat(true) end end
  4. Pay 'n' Spray system?
  5. Hey guys, i tried my own ways to define the export to set for it timer, i have no idea if it's possible ,thats why im asking maybe someone of you have an idea here's the example: local myMessage = exports.msg:message("Let's try this way",source,255,255,0) setTimer(myMessage,23000,1,source) it returns false with errors. ~Regards
  6. KariiiM

    not working

    Anyway,the code is safe of problems, just the marker is too small (tested) local marker = createMarker(2441.18262,2065,11.82031,"arrow",2) -- creating a marker local blip = createBlipAttachedTo (marker,33,1) -- attaching a blip to the marker function enter (hit) if ( getElementType(hit) ~= "player" or isPedInVehicle(hit) ) then return end -- make sure that the hit element is a player and the player is on foot fadeCamera(hit,false,1,0,0,0) -- make his camera go black setTimer(fadeCameraDelayed,1500,1,hit) -- after 1.5 sec do the fadeCameraDelayed function end -- end of the function addEventHandler("onMarkerHit",marker,enter) -- attaching the enter function to the marker function fadeCameraDelayed(player) -- This function prevents debug warnings when the player disconnects while the timer is running if (isElement(player)) then -- checking if the player didn't quit the game fadeCamera(player, true, 0.5) -- return his camera to normal after 0.5 sec end -- end of if end -- end of the function
  7. KariiiM

    not working

    Your marker was without color/alpha,btw just tell me what's wrong with this code because i have no idea about your project
  8. KariiiM

    not working

    local marker = createMarker(2441.18262,2065,11.82031,"arrow",1,255,0,0,255,root) -- creating a marker local blip = createBlipAttachedTo (marker,33,1) -- attaching a blip to the marker function enter (hit) if ( getElementType(hit) ~= "player" or isPedInVehicle(hit) ) then return end -- make sure that the hit element is a player and the player is on foot fadeCamera(hit,false,1,0,0,0) -- make his camera go black setTimer(fadeCameraDelayed,1500,1,hit) -- after 1.5 sec do the fadeCameraDelayed function end -- end of the function addEventHandler("onMarkerHit",marker,enter) -- attaching the enter function to the marker function fadeCameraDelayed(player) -- This function prevents debug warnings when the player disconnects while the timer is running if (isElement(player)) then -- checking if the player didn't quit the game fadeCamera(player, true, 0.5) -- return his camera to normal after 0.5 sec end -- end of if end -- end of the function
  9. Just restart it because there's a group system exported with scoreboard
  10. You can use this cmd, /scoreboard or press TAB
  11. It's a leaked script, none gonna help you for that, learn lua and do something by yourself.
  12. Working perfectly, you have to restart the script to change the cordinations. or use setTimer to change the locations with a timer, i added a blip to see it changing the place money = { [1]={31, -16, 4}, [2]={14, 7, 4}, [3]={19, 1, 3} } local pos = money[math.random(#money)] local x,y,z = unpack ( pos ) local randomra = createPickup (x,y,z, 3, 1274,20) local myBlip = createBlipAttachedTo (randomra,52) function pickupUse ( player ) givePlayerMoney ( player, 1000 ) end addEventHandler ( "onPickupUse", randomra, pickupUse)
  13. So, try that money = { [1]={31, -16, 4}, [2]={14, 7, 4}, [3]={19, 1, 3} } local pos = money[math.random(#money)] local x,y,z = unpack ( pos ) local randomra = createPickup (x,y,z, 3, 1274, 20 ) function pickupUse ( player ) givePlayerMoney ( player, 1000 ) end addEventHandler ( "onPickupUse", randomra, pickupUse )
  14. The table "money" is for cordinations? X, Y ,Z?
  15. Talk to MTA Developers
  16. KariiiM

    Ped distance

    addEventHandler ( 'onClientClick', root, function ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) and ( getElementType ( clickedElement ) == 'ped' ) then local x, y, z = getElementPosition(localPlayer) if getDistanceBetweenPoints3D(x, y, z, worldX, worldY, worldZ)<=13 then if ( not getPlayerTeam (localPlayer) or getTeamName ( getPlayerTeam (localPlayer) ) ~= 'Criminal' ) then sendMessage(" You must be criminal.",255,0,0) return end for i=1, #deliverys do if ( clickedElement == deliverys[i] ) then setElementData(deliverys[i], "del", true) if getElementData(deliverys[i],"del") then if ( guiGetVisible ( Window ) == false ) then guiSetVisible ( Window,true ) end end end end end end end)
  17. Anyway, i think i got you local m_Enter = createPickup(eX, eY, eZ,3,1273,0); setElementData( m_Enter, 'HS_INFO', { etX, etY, etZ, int, dim, cost, owner, key, ID } ); if getElementData( m_Enter, 'HS_INFO' )[7] ~= '' then setMarkerColor( m_Enter, 255, 51, 36, 150 ); end; addEventHandler ( "onPickupHit", m_Enter, function( player ) if getElementType( player ) == 'player' and not getPedOccupiedVehicle( player ) then if not getElementData( player, 'HP_Opened' ) then if not isGuestAccount( getPlayerAccount( player ) ) then setElementData( player, 'mrk_in', getElementData( source, 'HS_INFO' )[9] ); onPlayerHouseMarkerHit( player, source, true ); setElementFrozen( player, true ); else outputChatBox( '* You must be logged in to get in this house!', player, 255, 51, 36 ); end; end; end; end );
  18. You want to change the house object to green? i didn't get your point
  19. Also,another way local markercords = { [1]={mx=1945.20874, my=-1778.62756, mz=13.39060}, [2]={mx=1944.33765, my=-1773.98657, mz=13.39060}, [3]={mx=1944.09851, my=-1771.35437, mz=13.39060}, [4]={mx=1944.29260, my=-1767.30762, mz=13.38281} } addEventHandler("onResourceStart",resourceRoot, function () for index, data in pairs(markercords) do local marker = createMarker(data.mx, data.my, data.mz-1, "cylinder", 2, 255, 255, 0, 100) end end)
  20. and what's wrong with mine? local markercords = { [1]={1945.20874, -1778.62756, 13.39060}, [2]={1944.33765, -1773.98657, 13.39060}, [3]={1944.09851, -1771.35437, 13.39060}, [4]={1944.29260, -1767.30762, 13.38281} } addEventHandler("onResourceStart",resourceRoot, function () for i=1, #markercords do local x , y , z = markercords[i][1], markercords[i][2], markercords[i][3] local Marker = createMarker(x , y , z,"cylinder",2,255,255,0,100) end end)
  21. local accountname = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accountname , aclGetGroup ( "Admin" ) ) then --your code
  22. addEvent("check",true) addEventHandler("check",root, function (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer )) if isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Admin" ) ) then end end)
×
×
  • Create New...