Jump to content

zombie kill


Wei

Recommended Posts

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

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