Jump to content

[REL] Zday, a Zombie Infestation Script


Recommended Posts

yeah, sorry. my wiki access needs to be reset. so heres how:

setElementData(myRadarArea, "zombieProof", true )

just replace "myRadarArea" with the radar area you want zombieproofed. this will prevent zombies from spawning in that area. it will not prevent them from going into the area though, so you might want to build a fence.

Link to comment

What is wrong?

function onPlayerQuit ( ) 
      -- when a player leaves, store his current money amount in his account data 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerzombiekills = getPlayerZombieKills ( source ) 
            setAccountData ( playeraccount, "piraterpg.zombiekills", playerzombiekills ) 
      end 
end 
  
function onPlayerJoin ( ) 
      -- when a player joins, retrieve his money amount from his account data and set it 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) then 
            local playerzombiekills = getAccountData ( playeraccount, "piraterpg.zombiekills" ) 
            -- make sure there was actually a value saved under this key (check if playermoney is not false). 
            -- this will for example not be the case when a player plays the gametype for the first time 
            if ( playerzombiekills ) then 
                  setPlayerZombieKills ( source, playerzombiekills ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) 

Link to comment
if server ping is high, are zombies choppy?

all pedestrians in mta are automatically synced by one of the players ingame. mta uses its own system to choose who syncs them, and it does a good job of it.

when you are the syncer, the peds will always look smooth and operate very well. when someone else is the syncer and they have a high ping, then you migh notice some chopiness.

to avoid the impact of this, when a zombie attacks a person, it is scripted to set the syner to the person the zombie is chasing. this greatly reduces any problems.

in any event, the whole thing works well, but nothing in life is perfect.

Link to comment

from 1 page previous:

yeah, sorry. my wiki access needs to be reset. so heres how:

setElementData(myRadarArea, "zombieProof", true )

just replace "myRadarArea" with the radar area you want zombieproofed. this will prevent zombies from spawning in that area. it will not prevent them from going into the area though, so you might want to build a fence.

Link to comment
if server ping is high, are zombies choppy?

all pedestrians in mta are automatically synced by one of the players ingame. mta uses its own system to choose who syncs them, and it does a good job of it.

when you are the syncer, the peds will always look smooth and operate very well. when someone else is the syncer and they have a high ping, then you migh notice some chopiness.

to avoid the impact of this, when a zombie attacks a person, it is scripted to set the syner to the person the zombie is chasing. this greatly reduces any problems.

in any event, the whole thing works well, but nothing in life is perfect.

why zombie can sync only one player?

i think, this function is setElementSyncer.

Link to comment

That's what he said, didn't he? When the zombies attack someone, the script uses setElementSyncer to set the player being attacked as syncer for the zombies attacking. setElementSyncer can not add more players syncing btw, it can only change the player syncing peds.

Link to comment
Where can i see the anti zombie zone wiki page?
yeah, sorry. my wiki access needs to be reset. so heres how:

setElementData(myRadarArea, "zombieProof", true )

just replace "myRadarArea" with the radar area you want zombieproofed. this will prevent zombies from spawning in that area. it will not prevent them from going into the area though, so you might want to build a fence.

Link to comment

wohoo! ive finaly remembered the password! So here is my problem as i mentioned on comunity site. Im trying to do a zombie-free zone but that SetElementdata doesnt seem to work. it either doesnt work at all or the zombies dont spawn anywhere. the zone itself is functioning (green radar area and such) but the zombies dont work as they should. Please could you give me a hand with this one or post an example?

THX in advance

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