'LinKin Posted October 4, 2014 Posted October 4, 2014 Hello, I have this: addEventHandler("onClientPlayerWasted", root, function() setTimer(function(thePlayer) if isPedDead(thePlayer) then outputChatBox(getPlayerName(thePlayer).." isDead") else outputChatBox(getPlayerName(thePlayer).." isNotDead") end end, 2000, 1, source) end) When I'm alone in the server (Destruction Derby game-mode) and I die, it shows that I'm dead. So it's right. But when I'm not alone in the server and I die, it says that I am NOT dead.. If other player dies, it works OK, it shows that he's dead, but it seems it just doesn't work with me, why? Thanks. EDIT: I have tried by changing the timer's execution time. It seems that anything >= 2000 won't work. While anything < 2000 would work flawlessly. But I still wonder; Why with other players it works no matter what? (I tried setting the timer to 4000 ms and it still worked for other players). This script is client-side (obviously), do you think that the Laptop that I'm currently using is causing the trouble? because I don't really see any other reason.
'LinKin Posted October 4, 2014 Author Posted October 4, 2014 It wouldn't work for what I'm scripting it for.
Anubhav Posted October 4, 2014 Posted October 4, 2014 Oh god how would it work even? You have a extra end, addEventHandler("onClientPlayerWasted", root, function() setTimer(function(thePlayer) if isPedDead(thePlayer) then outputChatBox(getPlayerName(thePlayer).." isDead") else outputChatBox(getPlayerName(thePlayer).." isNotDead") end end, 2000, 1, source) )
darhal Posted October 4, 2014 Posted October 4, 2014 Omg anubhav why you give him wrong information where is the end of the line 4 function ! His code is correct
Anubhav Posted October 4, 2014 Posted October 4, 2014 Try using this addEventHandler("onClientPlayerWasted", localPlayer, function() setTimer(function(thePlayer) if isPedDead(thePlayer) then outputChatBox(getPlayerName(thePlayer).." isDead") else outputChatBox(getPlayerName(thePlayer).." isNotDead") end end, 2000, 1, source) )
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