Jump to content

Search the Community

Showing results for tags 'colshape'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 3 results

  1. I've recently found out that onClientColshapeHit triggers only when object's center hit the colshape Functions like getElementsWithinColShape and isElementWithinColShape work on the same principle. It's kinda bad because it affects the whole gamemode i make and makes it impossible to complete. I tried to use isLineOfSightClear function however i should use it on each unit of a single object. 9x9x9 object cause performance loss so this is a bad idea. Is there any other ideas?
  2. I tried to create Colshape-based antiDM system. It looks like this: antiDeathMatchColShapes= {353.71392822266, 170.66009521484, 1005.3893432617, 100, 100, 1, 3} animebankess = createPed (233, 359.71392822266, 173.66009521484, 1008.3893432617, -90) outputChatBox(tostring(animebankess)) setElementDimension ( animebankess, 1 ) setElementInterior ( animebankess, 3 ) addEventHandler("onClientResourceStart", getRootElement(), function () outputChatBox("Yeah!") outputChatBox(antiDeathMatchColShapes[1]) local i = 1 local count = 1 AntiDmZones = {} repeat outputChatBox("done once!") colX = antiDeathMatchColShapes[i] colY = antiDeathMatchColShapes[i+1] colZ = antiDeathMatchColShapes[i+2] colR = antiDeathMatchColShapes[i+3] colH = antiDeathMatchColShapes[i+4] colDim = antiDeathMatchColShapes[i+5] colInt = antiDeathMatchColShapes[i+6] table.insert(AntiDmZones, createColTube(colX, colY, colZ, colR, colH)) setElementDimension(AntiDmZones[count], colDim) setElementInterior(AntiDmZones[count], colInt) count = count + 1 i=i+8 until not antiDeathMatchColShapes[i] addEventHandler("onClientPedDamage", getRootElement(), function (attacker) local i = 1 while AntiDmZones[i] do outputChatBox(tostring(source)) checkOne = isElementWithinColShape(source, AntiDmZones[i]) checkTwo = isElementWithinColShape(attacker, AntiDmZones[i]) outputChatBox(tostring(checkOne)) outputChatBox(tostring(checkTwo)) if isElementWithinColShape(source, AntiDmZones[i]) or isElementWithinColShape(attacker, AntiDmZones[i]) then cancelEvent() end i=i+1 end end) addEventHandler("onClientPlayerDamage", getRootElement(), function (attacker) local i = 1 while AntiDmZones[i] do outputChatBox(tostring(getElementType(AntiDmZones[i]))) if isElementWithinColShape(source, AntiDmZones[i]) or isElementWithinColShape(attacker, AntiDmZones[i]) then cancelEvent() end i=i+1 end end) addEventHandler("onClientVehicleDamage", getRootElement(), function (attacker) local i = 1 while AntiDmZones[i] do outputChatBox(tostring(getElementType(AntiDmZones[i]))) if isElementWithinColShape(source, AntiDmZones[i]) or isElementWithinColShape(attacker, AntiDmZones[i]) then cancelEvent() end i=i+1 end end) addEventHandler("onClientPlayerStealthKill", getRootElement(), function (attacker) local i = 1 while AntiDmZones[i] do outputChatBox(tostring(getElementType(AntiDmZones[i]))) if isElementWithinColShape(source, AntiDmZones[i]) or isElementWithinColShape(attacker, AntiDmZones[i]) then cancelEvent() end i=i+1 end end) end) And even if ped inside the colshape, check returns false. But if player inside colshape - check returns true. Two hours spent to find out what is the problem - two hours just wasted. Sorry for my weird usage of loops.
  3. Hi everyone! have here server-side script local col = createColCircle(170, -377, 15) local object = createObject(737, 175, -377, 6) print(isElementWithinColShape(object, col)) -- print false Can anyone tell me, why i got false, when object IN colshape? Object and colshape have same coordinates.
×
×
  • Create New...