Jump to content

[REL] Zday, a Zombie Infestation Script


Recommended Posts

Posted

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.

Check out my recent work:

ZDay - a zombie script

Slothbot - an AI deathmatch bot

my community profile (all my resources)

Posted

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 ) 

Posted

getPlayerZombieKills?????? wtf?

i think you should do:

getElementData(source, "Zombie kills") 

and:

setElementData(source, "Zombie kills", playerzombiekills) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (edited)
define "perfect"

the zombies are synced for all players, but if a player is laggy you will notice some choppyness as the zombies resync themselves.

if server ping is high, are zombies choppy?

Edited by Guest
Posted
getPlayerZombieKills?????? wtf?

i think you should do:

getElementData(source, "Zombie kills") 

and:

setElementData(source, "Zombie kills", playerzombiekills) 

I'm new to this so I do not know these commands. I tried and still does not work: \

Posted

when a player joins he is not logged in, so you have to use onPlayerLogin as eventHandler,

addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerJoin ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

Check out my recent work:

ZDay - a zombie script

Slothbot - an AI deathmatch bot

my community profile (all my resources)

Posted

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.

Check out my recent work:

ZDay - a zombie script

Slothbot - an AI deathmatch bot

my community profile (all my resources)

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

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

Posted

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

Posted

Uhm, i have a question about your resource, is possible to set their dimension? like in the map file where you set the spawn points, Thanks in advance.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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