manawydan Posted January 17, 2013 Author Posted January 17, 2013 addEvent("onZombieSpawned",true) addEventHandler("onZombieSpawned",root, function ( ) local myBlip = createBlipAttachedTo ( source, 0 ) end)
Castillo Posted January 17, 2013 Posted January 17, 2013 That's because that event is not triggered by zombies, try with: "onZombieSpawn" instead.
manawydan Posted January 17, 2013 Author Posted January 17, 2013 addEvent("onZombieSpawn",true) addEventHandler("onZombieSpawn",root, function ( ) local myBlip = createBlipAttachedTo ( source, 0 ) end) no work
Castillo Posted January 17, 2013 Posted January 17, 2013 Try this and see if it says something on chat. addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, function ( ) outputChatBox ( "A ZOMBIE HAS JUST SPAWNED!" ) createBlipAttachedTo ( source, 0 ) end )
Castillo Posted January 17, 2013 Posted January 17, 2013 And no blip is attached? are you sure that it has no errors?
boro Posted January 18, 2013 Posted January 18, 2013 try server side addEventHandler ( "onZombieSpawn", root, function ( ) outputChatBox ( "A ZOMBIE HAS JUST SPAWNED!" ) createBlipAttachedTo ( ped, 0 ) end )
Castillo Posted January 18, 2013 Posted January 18, 2013 addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, function ( ) outputChatBox ( "Element type: ".. tostring ( getElementType ( source ) ) ) createBlipAttachedTo ( source, 0 ) end )
manawydan Posted January 18, 2013 Author Posted January 18, 2013 "Element type: player" whats source player?
3NAD Posted January 18, 2013 Posted January 18, 2013 addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, function ( ) for _, v in ipairs ( getElementsByType ( "ped" ) ) do if getElementData ( v, "zombie" ) then createBlipAttachedTo ( v, 0 ) end end end )
manawydan Posted January 18, 2013 Author Posted January 18, 2013 3NAD work thank you Solidsnake14 thank you boro thank you psydomin thank you
Castillo Posted January 18, 2013 Posted January 18, 2013 addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, function ( ) for _, v in ipairs ( getElementsByType ( "ped" ) ) do if getElementData ( v, "zombie" ) then createBlipAttachedTo ( v, 0 ) end end end ) This will create more than one blip for zombie I think.
manawydan Posted January 18, 2013 Author Posted January 18, 2013 how to destroy the blip (onZombieWasted)?
Castillo Posted January 18, 2013 Posted January 18, 2013 blips = { } addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, function ( ) for _, v in ipairs ( getElementsByType ( "ped" ) ) do if getElementData ( v, "zombie" ) then if ( not blips [ v ] ) then blips [ v ] = createBlipAttachedTo ( v, 0 ) end end end end ) addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( ) if ( isElement ( blips [ source ] ) ) then destroyElement ( blips [ source ] ) end end )
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