Jump to content

What wrong ?


Electro88

Recommended Posts

what wrong guys ?

line:6: attempt to perform arithmatic on a boolean value

addEvent('onZombieWasted', true) 
addEventHandler('onZombieWasted', root, 
function (attacker) 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(attacker)),aclGetGroup("Soldier")) then 
if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then 
       setElementData(attacker, "health",  getElementData( attacker, "health" ) + 5 ) 
       end 
    end 
 end 
 ) 

Link to comment
addEvent("onZombieWasted", true) 
addEventHandler("onZombieWasted", getRootElement(), 
function (attacker) 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(attacker)),aclGetGroup("Soldier")) then 
if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then 
       setElementHealth(attacker, getElementHealth(attacker) + 5) 
       end 
    end 
 end 
 ) 

Link to comment
Same error :/

Try this:

addEvent("onZombieWasted", true) 
addEventHandler("onZombieWasted", getRootElement(), 
function (attacker) 
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(attacker)),aclGetGroup("Soldier")) then 
       setElementHealth(attacker, (getElementHealth(attacker) or 0) + 5) 
    end 
end) 

Link to comment

I think 1Lol1's code @line6 is wrong because second argument of setElementData or getElementData is the information which you need to know, it's like: getElementData(player, "data") or setElementData(player, "data", value)

Your problem may come from another line but debugscript understands it differently, I can't help you since I don't know how is done the whole script which you're using..

Link to comment
I think 1Lol1's code @line6 is wrong because second argument of setElementData or getElementData is the information which you need to know, it's like: getElementData(player, "data") or setElementData(player, "data", value)

Your problem may come from another line but debugscript understands it differently, I can't help you since I don't know how is done the whole script which you're using..

Wrong? if he want set health he must use only setElementHealth not setElementData..

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