Jump to content

onPedWasted


dugasz1

Recommended Posts

Posted

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! :)

Posted

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 :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

  • Moderators
Posted
onPedWasted

Serverside 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 

  Tutorials  4x 

 

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