hi i want to make a water death!
#1

Hello guyz i want to make a water death.When someone fell in water he will die!and then he will spectate the first player!
Reply
#2

Theres a function called IsPlayerInWater ( Dunno who made it ) you should take a look at it, it might help you.
Reply
#3

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        if(strcmp(animlib,"SWIM",true)==0)
        {
        new Float:HP;GetPlayerHealth(playerid,HP);
        if(HP>10.0)
        {
                SetPlayerHealth(playerid,0.0);
        }
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Farsek
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        if(strcmp(animlib,"SWIM",true)==0)
        {
        new Float:HP;GetPlayerHealth(playerid,HP);
        if(HP>10.0)
        {
                SetPlayerHealth(playerid,0.0);
        }
        }
    }
    return 1;
}
Great code.
Reply
#5

thanks guyz i will test it!
Reply
#6

i got 1 error:
pawn Код:
TakeshisCastle[Minigames].pwn(463) : error 021: symbol already defined: "OnPlayerUpdate"
Reply
#7

....
Press ctrl+f, type "OnPlayerUpdate"(maybe you'll be redirected to 'my' OnPlayerUpdate but press "next") and put after:
public OnPlayerUpdate(playerid)
{

this:
pawn Код:
if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        if(strcmp(animlib,"SWIM",true)==0)
        {
        new Float:HP;GetPlayerHealth(playerid,HP);
        if(HP>10.0)
        {
                SetPlayerHealth(playerid,0.0);
        }
        }
    }
Compile,and when it's over,press 'F1' and start to read some stuff about pawn
Reply
#8

works!ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)