12.07.2011, 22:15
(
Последний раз редактировалось [R]ambo; 12.07.2011 в 23:02.
)
OOPS
CMD:heal( playerid, params[ ] )
{
if ( GetPlayerSkin( playerid ) != 287 )
return SendClientMessage( playerid, -1, "You are not an army member!" );
new
Float: pPos[ 3 ],
targetid = INVALID_PLAYER_ID
;
GetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
foreach (Player, i)
{
if ( IsPlayerInRangeOfPoint( i, 2.0, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] ) && i != playerid )
{
targetid = i;
}
}
if ( targetid == INVALID_PLAYER_ID || GetPlayerSkin( targetid ) != 287 )
return SendClientMessage( playerid, -1, "There are no army members near you." );
new
tempString[ 128 ],
pName[ 24 ],
jName[ 24 ]
;
GetPlayerName( playerid, pName, sizeof pName );
GetPlayerName( targetid, jName, sizeof jName );
format( tempString, sizeof tempString, "You have been healed by army member %s.", pName );
SendClientMessage( targetid, -1, tempString );
format( tempString, szieof tempString, "You have healed army member %s.", jName );
SendClientMessage( playerid, -1, tempString );
SetPlayerHealth( targetid, 100.0 );
targetid = INVALID_PLAYER_ID;
return 1;
}