Healing System Please Help!
#1

I want to be able to make my skin soldier, so that when he's beside his wounded teammate he's able to heal automatically. And that he's unable to heal other teammates.
Reply
#2

Did I helped you before in this Thread?

OH! I know what did you change!

pawn Код:
#include < a_samp >
#include < foreach >

new
    pUpdateTimer[ MAX_PLAYERS ]
;

public OnPlayerConnect( playerid ) {
    pUpdateTimer[ playerid ] = SetTimerEx( "healMembers", 1000, true, "i", playerid );
    return 1;
}

forward healMembers( playerid );
public healMembers( playerid )
{
    if ( GetPlayerSkin( playerid ) == 287 )
    {
        new
            Float: X, Float: Y, Float: Z, target = INVALID_PLAYER_ID;

        GetPlayerPos( playerid, X, Y, Z );

        foreach (Player, i)
        {
            if ( IsPlayerInRangeOfPoint( i, 2.0, X, Y, Z ) && i != playerid )
            {
                target = i;
            }
        }

        if ( GetPlayerSkin( target ) == 287 )
        {
            new Float: pHealth;
            GetPlayerHealth( target, pHealth );
            if ( pHealth != 100.0 ) {
                SetPlayerHealth( target, pHealth + 4.0 );
                GameTextForPlayer( target, "~w~Being healed", 500, 3 );
            }
        }
    }
    return 1;
}
EDIT: Added a quick filterscript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)