Jump to content

its me again... help with colshape


5150

Recommended Posts

is there any way to make a colshape that, when u enter it, will prevent people from warping to you? not the securezone mod, i mean it literally says "you cant warp to this person right now" or (something like that) when the other player is in that colshape

Link to comment
is there any way to make a colshape that, when u enter it, will prevent people from warping to you? not the securezone mod, i mean it literally says "you cant warp to this person right now" or (something like that) when the other player is in that colshape

Yes, here's an example.

local colShape = createColSphere (0,0,0,50) 
setElementData (colShape,"warpproof",true) 
  
  
addCommandHandler ("warp",function(executer) 
    for i,colshapes in ipairs (getElementsByType("colshape")) do 
        if getElementData (colshapes,"warpproof") then 
        if isElementWithinColShape (executer,colshapes) then 
        outputChatBox ("You can't warp from here!",executer) 
        return 
        end 
  
        end 
    end 
end) 

Link to comment

i think were on different pages lol.... i mean:

i have a secret zone in my server.

no one can get to it EXCEPT if they warp to me while im in it

i dont want them to be able to warp to me, but ONLY when im inside the area

the securezone mod does this but with a delay..

Link to comment

Depends what you mean by warping. Are you using the freeroam resource, or..? If so, then you need to implement your own way to fix it so that you can't warp while x things are enabled. If you're using something else to warp, then we'd need to see the code to help you.

To answer your initial question: yes, it is possible, even if you're using the freeroam resource.

Link to comment

im using freeroam yes. and let me try to explain it better....

i mean,

i want an area that only the admin ACL has access to.

meaning, no matter what a normal player does, they cannot get inside that area

i have a current resource called securezone, that will warp you out on a timer

the problem with that is people can see whats inside in that 1 second before they are warped out xD

i hope that helps :P

Link to comment
im using freeroam yes. and let me try to explain it better....

i mean,

i want an area that only the admin ACL has access to.

meaning, no matter what a normal player does, they cannot get inside that area

i have a current resource called securezone, that will warp you out on a timer

the problem with that is people can see whats inside in that 1 second before they are warped out xD

i hope that helps :P

Well. You could map collisions around the base, or implement a smart collision object which rotates around the colshape correspondingly to the position of the player, so you only need one element for that.

It's not going to be easy, so you want to think first. Use securezone and make the timer faster, or then don't use securezone and spend a few days figuring out how to make the difficult code.

Link to comment

its not a fact of them walking into the colshape guys.... the secret area is inside mount chiliad (under the map), so the colshape is around most of the mountain. people cannot walk into the secret area inside the mountain, because duh its INSIDE the mountain. the only way to get in currently is to warp to me after im already in it. so it wouldnt matter if i made the colshape bigger, because they would still just warp to where i do not want them. here is the client script for my securefortress mod. (its securezone but for the mountain)

  
--COPY AND PASTE THIS, CHANGE WARP1 AND DISPLAYTIMER-- 
addEvent("displayTimer1", true) 
addEventHandler("displayTimer1", root, 
function() 
     addEventHandler("onClientRender", root, draw) 
     if isTimer(timer) then killTimer(timer) end 
     timer = setTimer(function() 
          removeEventHandler("onClientRender", root, draw) 
          triggerServerEvent("warp1", localPlayer) 
     end,250,1) 
end) 
------------------------------------------------------- 
  
  
 --LEAVE THIS ALONE-- 
function draw() 
  if isTimer(timer) then 
          local timeLeft = math.ceil(getTimerDetails(timer) / 250) 
          dxDrawText("To leave the area!",557.0,318.0,872.0,368.0,tocolor(255,0,0,255),2.0,"default","left","top",false,false,false) 
          dxDrawText(tostring(timeLeft),630.0,277.0,690.0,324.0,tocolor(255,0,0,255),3.0,"default","left","top",false,false,false) 
          dxDrawText("You have: ",546.0,224.0,725.0,271.0,tocolor(255,0,0,255),4.0,"default","left","top",false,false,false) 
     end 
end 

the 250 is the miliseconds. thats the lowest i could get it

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...