Healing System Please Help!
#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


Messages In This Thread
Healing System Please Help! - by [R]ambo - 12.07.2011, 22:58
Re: Healing System Please Help! - by Basicz - 12.07.2011, 23:08

Forum Jump:


Users browsing this thread: 2 Guest(s)