dugasz1 Posted August 20, 2013 Posted August 20, 2013 Hello! function died() outputConsole("A ped die!") end addEventHandler("onPedWasted", getRootElement(), died) I wannt a function what si start at when a ped die. On the wiki its whit one ped(2th arg is the ped) but i want it whit all the peds. How its possible? (Client side event doesnt good) Sorry for lot of questions and thanks for the answers!
bandi94 Posted August 20, 2013 Posted August 20, 2013 Use server side. Server side function died() if getElementType(source)=="Player" then outputChatBox("Player "..getPlayerName(source).. " died!") else outputChatBox("A ped die!") end end addEventHandler("onPedWasted", getRootElement(), died) Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
dugasz1 Posted August 20, 2013 Author Posted August 20, 2013 Thanks its working Sorry for lot of questions and thanks for the answers!
Moderators IIYAMA Posted August 20, 2013 Moderators Posted August 20, 2013 onPedWastedServerside event This event is triggered when a ped is killed or dies. It is not triggered for players. use onPlayerWasted as well. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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