Jump to content

isPedDead Issue


'LinKin

Recommended Posts

Posted

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.

Need a clanwar script? Click here!

Do you want some free scripts for your DD server? Visit my website.

Posted

Use this code server side better !

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

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

Posted

Omg anubhav why you give him wrong information where is the end of the line 4 function ! His code is correct

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

Nope but becareful next time ! :)

#include <iostream>

int main() {

    std::cout << "C++ is amazing <3" << std::endl;

    return 0;

}

I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please

Posted

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

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