golanu21 Posted August 2, 2013 Share Posted August 2, 2013 addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) local kills = getElementData ( killer, "Zombie kills" ) if ( kills == 3 ) then givePlayerMoney(source, 100) triggerClientEvent("mis1", getRootElement()) end end ) addEventHandler("onPlayerQuit", root, function() local kills = getElementData ( killer, "Zombie kills" ) setAccountData (source, "kills", kills) end) addEventHandler("onPlayerLogin", root, function(killer) kills = getAccountData(source, "kills") if ( kills == 3) then triggerClientEvent("mis1", getRootElement()) end end) Q1: i want to save the zombie kills in setAccountData when zombieKills reach 3, and when player is login, to start the triggerClientEvent again Q2 : i can make that? if 3 >= kills >= 6 then ... kills is including between 3 an 6 Link to comment
DNL291 Posted August 2, 2013 Share Posted August 2, 2013 addEventHandler ( "onZombieWasted", root, function ( killer ) local kills = getElementData ( killer, "Zombie kills" ) if (kills >= 3 and kills <= 6) then givePlayerMoney(killer, 100) triggerClientEvent("mis1", getRootElement()) end end ) addEventHandler("onPlayerQuit", root, function() local kills = getElementData ( source, "Zombie kills" ) setAccountData( getPlayerAccount(source), "kills", kills ) end) addEventHandler("onPlayerLogin", root, function(_, account) local kills = getAccountData(account, "kills") if (kills >= 3 and kills <= 6) then triggerClientEvent("mis1", getRootElement()) end end) Q2 : i can make that? if 3 >= kills >= 6 then ... kills is including between 3 an 6 Must be: if (kills >= 3 and kills <= 6) then Link to comment
golanu21 Posted August 2, 2013 Author Share Posted August 2, 2013 this is , thanx man, 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