What function should i use?
#1

Im making a script that, once somone shoots a person with the sniper, the persons health will be set to zero. I believe 0.3D has a function that lets me do so, if so, what is it?
Reply
#2

Very simple!

pawn Код:
/* Works only for 0.3d*/
public OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid )
{
    if ( issuerid != INVALID_PLAYER_ID )
    {
        if ( GetPlayerWeapon( issuerid ) == 34 )
        {
            SetPlayerHealth( playerid, 0.0 );
            SetPlayerArmour( playerid, 0.0 );
        }
    }

    return 1;
}
Reply
#3

Quote:
Originally Posted by admantis
Посмотреть сообщение
Very simple!

pawn Код:
/* Works only for 0.3d*/
public OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid )
{
    if ( issuerid != INVALID_PLAYER_ID )
    {
        if ( GetPlayerWeapon( issuerid ) == 34 )
        {
            SetPlayerHealth( playerid, 0.0 );
            SetPlayerArmour( playerid, 0.0 );
        }
    }

    return 1;
}
You don't actually need to use GetPlayerWeapon on the issuerid as there is a param for that in the function .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)