Jump to content

GTX

Members
  • Posts

    1,273
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GTX

  1. Closes after 5 seconds. local gate = createObject ( 969, 209.69999694824, 1875.3000488281, 12.10000038147, 0, 0, 0 ) local state = false addCommandHandler ( "op", function ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Everyone" ) ) then if ( not state ) then outputChatBox("Portail de protection DESACTIVER !",thePlayer, 255,0,0,false) moveObject ( gate, 3000, 218, 1875.3000488281, 12.10000038147, 0, 0, 0 ) setTimer(function() moveObject ( gate, 3000, 209.69999694824, 1875.3000488281, 12.10000038147, 0, 0, 0 ) state = false end, 5000, 1) else moveObject ( gate, 3000, 209.69999694824, 1875.3000488281, 12.10000038147, 0, 0, 0 ) outputChatBox("Portail de protection ACTIVER !",thePlayer, 17,251,0,false) end state = ( not state ) else outputChatBox("Vous n'êtes pas un membres enregistré du serveur !",thePlayer,235,0,0,true) end end )
  2. Changing the mass will sure change the moving behavior of an object, especially for dynamic objects. For the scale part, you cannot change the collision box. It will stay the same as it originally is. Maybe you could try something with: engineLoadCOL engineReplaceCOL
  3. For the text: setElementData(yourblip, "name", "whatever you want") For the color (now it will be green): setElementData(yourblip, "color", {0, 255, 0})
  4. outputChatBox("[Admin Tag Created By x[Eminem]x]", getRootElement(), 200, 155, 45, true) function mm ( text ) setTimer ( mm2, 1000, 1 ) end function mm2 ( ) local m1 = "#FFFFFFEminem" outputChatBox(' #ff0000x[Eminem]x #A0990ACreated #000FFFThis', getRootElement(), 0, 0, 0, true) outputChatBox('| |', getRootElement(), 0, 0, 0, true) outputChatBox('|...........Do Not Change Script............ ', getRootElement(), 0, 0, 0, true) outputChatBox('|..................Eminem Created This....................|', getRootElement(), 0, 0, 0, true) end setTimer ( mm, 1000, 1, " " )
  5. Actually, Gr0x his code is alright, with slight modifications. taken = {} for i, v in ipairs(getElementsByType"vehicle") do for i=1, 5 do if isElementWithinColShape(v, cuboid[i]) then taken[i] = v break end end end for i=1, 5 do if taken[i] then outputChatBox(i.." taken by "..getVehicleName(taken[i])) else outputChatBox(i.." is free") end end If this doesn't work, give me the full code, I'll test it.
  6. He can but it's not good. If you need to add 100 teams, what would you do then?
  7. You don't need any modloader. Use: engineLoadTXD engineImportTXD
  8. viewtopic.php?f=91&t=70747&p=657875&hilit=getPlayerMapBoundingBox#p658114 Here's an example.
  9. GTX

    Ipairs iterator

    With setElementData assign an ID (they must be related to you table indexes) to an object. Why do you need pairs if you iterate through indexes? And please, tabulate your code. It looks very messy. local objects = {} addEvent ("objs",true) addEventHandler ("objs",getRootElement(), function() for i, v in ipairs(mines) do local x, y, z = unpack(v) objects[i] = createObject(3929, x, y, z) setElementData(objects[i], "id", i) setElementData(objects[i], "mineununtrium", "true") setElementData(objects[i], "qununtrium", 5) local marker = createMarkerAttachedTo(objects[i], "corona", 4, 255, 255, 255, 50, getRootElement(), 0, 0, 10) end end ) I hope you know what to do next.
  10. I've been fiddling with this case, I've tested out some methods and came to a solution: Client: addCommandHandler("cre", function(cmd, oid) local selectedElement = exports.editor_main:getSelectedElement() if getElementType(selectedElement) == "object" and tonumber(oid) then local x, y, z = getElementPosition(selectedElement) local rx, ry, rz = getElementRotation(selectedElement) triggerServerEvent("e:import", root, tonumber(oid), x, y, z, rx, ry, rz) end end ) Server: addEvent("e:import", true) addEventHandler("e:import", root, function(id, x, y, z, rx, ry, rz) local element = createObject(id, x, y, z, rx, ry, rz) exports.editor:import(element) destroyElement(element) end )
  11. GTX

    [HELP]With PED

    You're welcome and no problem
  12. I didn't give you EDF functions? What are you doing lol? objects = {} addCommandHandler("cre",function (cmd, oid) local selectedElement = exports.editor_main:getSelectedElement() if oid then local x,y,z = getElementPosition(selectedElement) local rx, ry, rz = getElementRotation(selectedElement) objects[selectedElement] = createObject(oid,x,y,z,rx,ry,rz) if isElement(objects[selectedElement]) then destroyElement(objects[selectedElement]) end end end )
  13. GTX

    [HELP]With PED

    local blipPos = { {1303.72, 1502.84, 10.82}, {1304.8, 1254.75, 10.82} } local blips = {} for i=1, #blipPos do blips[i] = createBlip(blipPos[i][1], blipPos[i][2], blipPos[i][3], 23, 2, 0, 170, 15, 255) setBlipVisibleDistance(blips[i], 500) end
  14. Send message to the server sided script, then from there, send it to client side using first optional argument bool triggerClientEvent ( [table/element sendTo=getRootElement()], string name, element sourceElement, [arguments...] ) sendTo - To which player you want to send.
  15. GTX

    [HELP]With PED

    Much faster and efficient.
  16. GTX

    [HELP]With PED

    Client: local pedPos = { {1304.8, 1254.75, 10.82}; {1844.0552978516, -2640.2033691406, 13}; } local skins = {287} local peds = {} addEventHandler("onClientResourceStart", resourceRoot, function() for i=1, #pedPos do peds[i] = createPed(skins[math.random(1, #skins)], pedPos[i][1], pedPos[i][2], pedPos[i][3]) if peds[i] then setElementData(peds[i], "shop", true) setElementFrozen(peds[i], true) if pedPos[i][4] then setPedRotation(peds[i], pedPos[i][4]) end end end end ) addEventHandler ( 'onClientClick', root, function ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) and ( getElementType ( clickedElement ) == 'ped' ) then for i=1, #peds do if ( clickedElement == peds[i] ) then if ( guiGetVisible ( window ) == false ) then guiSetVisible ( window,true ) end end end end end )
  17. I'm gonna give you functions which you need to use to make that. Try to make it and if you have errors, post here. exports.editor_main:getSelectedElement() -- To get element you selected in editor. getElementPosition -- Use it on exported function to get position of an element you selected. getElementRotation -- Use it on exported function to get rotation of an element you selected. addCommandHandler createObject exports.editor:import() -- To import back to editor if you wish.
  18. The point is, you can't return from the same function where fetchRemote is. Blame MTA developers, lol. function getServerIP() fetchRemote("192.168.0.101/getServerIP.php", returned) end function returned(ip) outputChatBox(ip) end
  19. Well, you did it, didn't you? iMr.Dawix~# provided you the code, which should work. objects = {} addCommandHandler("create", function (player,cmd,oid) if tonumber(oid) then if objects[player] then destroyElement(objects[player]) end local x,y,z = getElementPosition(player) local rx,ry,rz = getElementRotation(player) objects[player] = createObject(tonumber(oid),x,y,z,rx,ry,rz) end end ) /create [iD]
  20. GTX

    Group types

    I think cancelEvent could do the job. I'm not familiar with xXMadeXx his group system. addEvent ("onPlayerJoinJob", true) addEventHandler( "onPlayerJoinJob", root, function (player) local gang = exports.NGGroups:getPlayerGroup ( player ) if gang ~= "Gang" then cancelEvent() end end )
  21. Mhm, try: function getServerIP() return fetchRemote("192.168.0.101/getServerIP.php",function(ip) return ip end) end outputChatBox(getServerIP())
  22. GTX

    Slothbot problems

    Try this: function onBotFindEnemy(ped) if isElement(ped) and getElementType(ped) ~= "player" then cancelEvent() end end addEvent("onBotFindEnemy", true) addEventHandler("onBotFindEnemy", root, onBotFindEnemy) It must work.
  23. function getServerIP() fetchRemote("yourwebsite.com/ip.php",function(ip) return ip end) end Put this on your webserver: <?php echo $_SERVER['REMOTE_ADDR']; ?>
×
×
  • Create New...