Wei Posted July 9, 2012 Share Posted July 9, 2012 function removeZombiesIfNotLasVenturas() for k, v in ipairs (getElementByType("ped")) do if not isElementWithinColShape( v, zombiesZone ) then if isPedZombie( v ) then killPed( v ) end end end end addEventHandler("onClientRender", getRootElement(), removeZombiesIfNotLasVenturas) why it doesn't kill the zombie? or zombie is not ped? Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 getElementByType It's: getElementsByType Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 killPed is a server side function. Link to comment
50p Posted July 9, 2012 Share Posted July 9, 2012 function removeZombiesIfNotLasVenturas() for k, v in ipairs (getElementByType("ped")) do if not isElementWithinColShape( v, zombiesZone ) then if isPedZombie( v ) then killPed( v ) end end end end addEventHandler("onClientRender", getRootElement(), removeZombiesIfNotLasVenturas) why it doesn't kill the zombie? or zombie is not ped? Don't use onClientRender for this. Use onColShapeHit if you created a col shape (https://wiki.multitheftauto.com/wiki/OnColShapeHit) and do it server-side or triggerServerEvent to killPed but I don't see any reason why it should be client-side. Link to comment
Wei Posted July 9, 2012 Author Share Posted July 9, 2012 (edited) - Edited July 9, 2012 by Guest Link to comment
Wei Posted July 9, 2012 Author Share Posted July 9, 2012 bump. What's the easiest way to have peds only inside col shape ? Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 addEventHandler ( "onColShapeLeave", theColshape, function ( leaveElement ) if ( leaveElement and getElementType ( leaveElement ) == "ped" ) then if ( exports [ "zombies" ]:isPedZombie ( leaveElement ) ) then killPed ( leaveElement ) end end end ) Link to comment
Wei Posted July 9, 2012 Author Share Posted July 9, 2012 but zombies can spawn outside of col shape. I wanna have them in col shape only Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 You can make spawnpoints inside the colshape, then set the spawn method at the "meta.xml" of "zombies" to spawn only on spawnpoints. Link to comment
Wei Posted July 9, 2012 Author Share Posted July 9, 2012 Yeah. I will do that. I thought that there is a easier way. Thanks anyway. Link to comment
Wei Posted July 9, 2012 Author Share Posted July 9, 2012 Why I don't have definition in map editor Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 Did you load the "zombies" definition? Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 I don't remember right now, but there's a button called "definitions" or something like that. Link to comment
Wei Posted July 9, 2012 Author Share Posted July 9, 2012 Yeah I know but I don't have it there Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 Is the "zombies" resource at the same server your map editor is? Link to comment
Castillo Posted July 9, 2012 Share Posted July 9, 2012 I loaded "zombies" definition without problems. Link to comment
Wei Posted July 9, 2012 Author Share Posted July 9, 2012 ok make it work where is some picture ? to use it Link to comment
Ransom Posted July 17, 2012 Share Posted July 17, 2012 I loaded "zombies" definition without problems. What was the point of that post? That isn't helpful? Blazy you need a better understanding of how the editor works? https://wiki.multitheftauto.com/wiki/Resource:Editor/EDF There should be a file within the zombie resource with a .edf extension. Therefore if you are trying to run map editor thru main menu this resource needs to be in the local mta server resources folder. If you are running a dedicated server (that is, the one independent of the client) and you start map editor from inside the server, you need the resource in the resource folder of the dedicated server's resources folder. In other words: Starting a server or map editor from MTASA main menu will use a local 'quickstart' server that has totally separate files and resources. If the edf isn't showing up in the editor then the scan for EDFs failed to find it. Edit I just did some confirming: I put zombies in the resources dir, did refresh, started the editor and zombies appeared in the 'definitions' selector So it's all working The editor is unrealiable though He should try installing MTA to a new directory and see if that helps There you go straight from the dev You can always try our scripting channel at irc.mutitheftauto.com #mta-scripting (or click the IRC CHAT link up top) ... it is not instant gratification but it can be faster than forums. Link to comment
Wei Posted July 17, 2012 Author Share Posted July 17, 2012 I've fixed problem now... Thanks... Link to comment
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