Jump to content

Placing a Safe Zone - Alternative - Help! - Solved by myself


12p

Recommended Posts

Posted (edited)

Well, I have modify the "zombies" resource, and I want to have a Safe Zone... But I don't want to use interiors, or the EDF or the "spawnZombie" function... So I just added these lines, but doesn't work:

safeZoneShape = createColCuboid (2720.1, -2565.81, 0, 90.65, 255.16, 1000) 
setTimer ( 
function () 
 if isElementWithinColShape (zomb, safeZoneShape) then 
   destroyElement (zomb) 
 end 
end,50,0) 

I have no debug errors or warnings, and zombies spawn in the colshape anyway. What's the bad thing here?

Edited by Guest
Posted

Much things are not okay in this. I Suggest you to get back to lua basics.

Oh, i think i got your way of thinking.

Use get elements within col shape (check wiki list of available functions for exact name) then loop with

 for key, val in ipairs do 
-- action here 
end 

And in loop check if element is ped ( you don't want to destroy the players) and if it is - destroy. Use get element type. Search Wiki again

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...