manawydan Posted January 17, 2013 Share Posted January 17, 2013 blip as putting in all living zombies? Link to comment
psydomin Posted January 17, 2013 Share Posted January 17, 2013 use createBlipAttachedTo the zombies Link to comment
manawydan Posted January 17, 2013 Author Share Posted January 17, 2013 addEvent("onZombieSpawned",true) addEventHandler("onZombieSpawned",root, function ( ) local myBlip = createBlipAttachedTo ( source, 0 ) end) Link to comment
Castillo Posted January 17, 2013 Share Posted January 17, 2013 That's because that event is not triggered by zombies, try with: "onZombieSpawn" instead. Link to comment
manawydan Posted January 17, 2013 Author Share Posted January 17, 2013 addEvent("onZombieSpawn",true) addEventHandler("onZombieSpawn",root, function ( ) local myBlip = createBlipAttachedTo ( source, 0 ) end) no work Link to comment
Castillo Posted January 17, 2013 Share Posted January 17, 2013 You set it as server side, right? Link to comment
Castillo Posted January 17, 2013 Share 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 ) Link to comment
manawydan Posted January 17, 2013 Author Share Posted January 17, 2013 the message usually appears Link to comment
Castillo Posted January 17, 2013 Share Posted January 17, 2013 And no blip is attached? are you sure that it has no errors? Link to comment
manawydan Posted January 17, 2013 Author Share Posted January 17, 2013 no blip, no erros. Link to comment
psydomin Posted January 17, 2013 Share Posted January 17, 2013 Most certanly the zombie isnt the source Link to comment
boro Posted January 18, 2013 Share Posted January 18, 2013 try server side addEventHandler ( "onZombieSpawn", root, function ( ) outputChatBox ( "A ZOMBIE HAS JUST SPAWNED!" ) createBlipAttachedTo ( ped, 0 ) end ) Link to comment
Castillo Posted January 18, 2013 Share Posted January 18, 2013 addEvent ( "onZombieSpawn", true ) addEventHandler ( "onZombieSpawn", root, function ( ) outputChatBox ( "Element type: ".. tostring ( getElementType ( source ) ) ) createBlipAttachedTo ( source, 0 ) end ) Link to comment
manawydan Posted January 18, 2013 Author Share Posted January 18, 2013 "Element type: player" whats source player? Link to comment
3NAD Posted January 18, 2013 Share 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 ) Link to comment
manawydan Posted January 18, 2013 Author Share Posted January 18, 2013 3NAD work thank you Solidsnake14 thank you boro thank you psydomin thank you Link to comment
Castillo Posted January 18, 2013 Share 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. Link to comment
manawydan Posted January 18, 2013 Author Share Posted January 18, 2013 how to destroy the blip (onZombieWasted)? Link to comment
Castillo Posted January 18, 2013 Share 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 ) 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