Jump to content

f8upd8

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by f8upd8

  1. Воспользуйтесь функцией выделения кода и скиньте исключения, которые выбрасывает ваш код в консоль.
  2. Пробовали наблюдать/провоцировать баг сами? Звучит очень подозрительно. В МТА отличная защита от читов, но никакая защита не абсолютна. Рекомендую хранить машины/бизнесы/ что-бы там ни было в XML, либо, если сильно важна производительность, в базе данных. Это исключит саму возможность third party, и, если имеет место баг, прекратит его провоцировать.
  3. I had that problem to. There is my way to fix this issue: kurisu = createPed (39, 359.71392822266, 173.66009521484, 1010.3893432617, -90) addEventHandler("onResourceStart", getRootElement(), function () setTimer(function () kurisuDance = setPedAnimation(kurisu, "dancing", "dnce_m_e", -1, true, false, false, false) end, 100, 1) end) Yes, yes. Let server to rest a bit after spawning ped.
  4. You can create colshape with a size of desired marker and use onCoShapeHit. I hope it will be acceptable until bug isn't fixed.
  5. If you want to survive here, please attach your debug text here when asking for help. And please, when nesting cod into any new area, use TAB's spaces.
  6. setTimer(respawn, 5000, 1, source) setTimer(setElementModel,5000,1,source,skin) Syntax is incorrect. If function needs any arguments, use timer like this: setTimer(function () setElementModel(source, skin) end, 5000, 1) And just for your sake, wipe out of the world's face this: repeat until spawnPlayer(source,x+1, y+1,z, 0, math.random(1,1) )
  7. Actually, problem was in freeze state of my ped. Because they're didi not move, colshape hit never happened. When i removed freeze state and hit my ped with grenade, both checks returned true. So i decided not to remove freeze state, i decided to spawn ped a quite upper (Z coord), so ped moves any way and colshape hit is happening. Colshape and ped is in same dimension and interior.
  8. It's all lies. I reloaded server, and first check returned false again. Awww. crap!
  9. Guys... Imma very, very angry now, because i wasted three hours finding error in my little code, but it is a MTA bug. When i re-connected to the server, interior and ped loaded normally, and both checks returned true. Before, i just reloaded hundred and hundred times my script by resource manager. Visually, ped was exist. But in fact - client thinked that source Ped is outside the colshape. All working fine now. Thank you.
  10. 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.
×
×
  • Create New...