Jump to content

I need help (zombies...)


Recommended Posts

I used to have a script almost same as this you want. I don´t remember it very good but if you have the zombiekills_scoreboard resource you can do something like this:

  
function 100kills(_, account) 
local kills = getAccountData ( account, "Zombiekills" ) 
if ( player == source ) then 
if ( kills == 100 ) then 
outputChatBox ( "You have killed 100zombies!!!", getLocalPlayer(), 255, 255, 255 ) 
end 
end 
  

If someone else see any errors or something missing please correct it.

Edited by Guest
Link to comment
and who is the player in
if ( player == source ) then 

I said that if something is missing or wrong please correct, I don´t remember the script I used long time ago so much. And I think that GamerDeMTA want to get an answear, haha.

GamerDeMTA, you download zombiekills_scoreboard from community. Then you have to create a script by yourself with almost that code I wrote.

Edited by Guest
Link to comment
addEventHandler("onPlayerSpawn",root, 
function() 
    local account = getPlayerAccount(source) 
    local zombiekills = getAccountData(account,"Zombie kills") or 0 
    if (zombiekills == 100) then 
    outputChatBox ( "You have killed 100zombies!!!", source, 255, 255, 255 ) 
    end 
end 
) 

Link to comment
addEventHandler("onPlayerSpawn",root, 
function() 
    local account = getPlayerAccount(source) 
    local zombiekills = getAccountData(account,"Zombie kills") or 0 
    if (zombiekills == 100) then 
    outputChatBox ( "You have killed 100zombies!!!", source, 255, 255, 255 ) 
    end 
end 
) 

That will not work...

onZombieWasted

This triggers when a zombie is killed. Parameters

element attacker, float weapon, float bodypart

attacker: The Element that killed the zombie

weapon: The weapon id used to kill the zombie

bodypart: The bodypart id that was hit to kill the zombie

Source

The source of this event is the zombie that died

And now you need a costum save system for the kills.

Also:

https://wiki.multitheftauto.com/wiki/Slothman/Zombies

Chek it out for more usefull functions

Link to comment
  • MTA Team

Without custom kill save:

addEventHandler("onPlayerSpawn",root, 
function() 
    local zombiekills = getElementData(source,"Zombie kills") 
    if (zombiekills == 100) then 
    outputChatBox ( "You have killed 100zombies!!!", source, 255, 255, 255 ) 
else 
outputChatBox ( "#00ffffYou have killed:#ff0000 " ..tonumber(zombiekills), source, 255, 255, 255,true ) 
    end 
end 
) 

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