DRW Posted May 26, 2015 Posted May 26, 2015 Hello, I want to disable damage dealing only to players if they are in a colshape. I mean, if a player shoots me he won't deal any damage, but if a zombie attacks me, then he will deal damage to me, it's not working. Client-sided colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) addEventHandler ("onClientPlayerDamage",localPlayer, function (attacker) if isElementWithinColShape (localPlayer, colRec) and getElementData (attacker, "player") then cancelEvent () end end ) Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
Walid Posted May 26, 2015 Posted May 26, 2015 local colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) local colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) local col = {colRec,colRad} addEventHandler ("onClientPlayerDamage",localPlayer, function (attacker) for i , v in pairs (col) do if isElementWithinColShape (source, v) then cancelEvent () end end end ) Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
DRW Posted May 26, 2015 Author Posted May 26, 2015 local colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) local colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) local col = {colRec,colRad} addEventHandler ("onClientPlayerDamage",localPlayer, function (attacker) for i , v in pairs (col) do if isElementWithinColShape (source, v) then cancelEvent () end end end ) Seems to not be working. Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
WhoAmI Posted May 26, 2015 Posted May 26, 2015 colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) addEventHandler ( "onClientPlayerDamage", localPlayer, function (attacker) if getElementType ( attacker ) == "player" then if isElementWithinColShape ( source, colRec ) then cancelEvent () end end end )
DRW Posted May 26, 2015 Author Posted May 26, 2015 colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) addEventHandler ( "onClientPlayerDamage", localPlayer, function (attacker) if getElementType ( attacker ) == "player" then if isElementWithinColShape ( source, colRec ) then cancelEvent () end end end ) getElementType expected element at argument 1, got boolean Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
WhoAmI Posted May 26, 2015 Posted May 26, 2015 colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) addEventHandler ( "onClientPlayerDamage", localPlayer, function (attacker) if isElement ( attacker ) and getElementType ( attacker ) == "player" then if isElementWithinColShape ( source, colRec ) then cancelEvent () end end end )
DRW Posted June 1, 2015 Author Posted June 1, 2015 colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) addEventHandler ( "onClientPlayerDamage", localPlayer, function (attacker) if isElement ( attacker ) and getElementType ( attacker ) == "player" then if isElementWithinColShape ( source, colRec ) then cancelEvent () end end end ) Doesn't work Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
Walid Posted June 1, 2015 Posted June 1, 2015 Try this it should work colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) col = {colRec,colRad} addEventHandler("onClientPlayerDamage", root, function() if isElementWithinGreenzone(source) then cancelEvent() end end) function isElementWithinGreenzone(element) if (not isElement(element)) then return false end for i, zone in pairs(col) do if (isElementWithinColShape(element, zone)) then return true end end return false end Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
DRW Posted June 8, 2015 Author Posted June 8, 2015 Try this it should work colRec = createColRectangle (-1203.599609375, 2814.75, 500,500) colRad = createRadarArea (-782.689453125, 656.4794921875, 1700,2200,0,0,0,100) col = {colRec,colRad} addEventHandler("onClientPlayerDamage", root, function() if isElementWithinGreenzone(source) then cancelEvent() end end) function isElementWithinGreenzone(element) if (not isElement(element)) then return false end for i, zone in pairs(col) do if (isElementWithinColShape(element, zone)) then return true end end return false end Still not working D: Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
Walid Posted June 8, 2015 Posted June 8, 2015 Still not working D: i already tested it and it's working fine. Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
DRW Posted June 8, 2015 Author Posted June 8, 2015 Still not working D: i already tested it and it's working fine. Sure it's making attackers to not deal damage to players? Because people in my server keep DMing in those zones Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now