Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rightclick <- BindKey(true, 0x02, 0, 0);
- function onKeyDown( player, key ){
- if( key == rightclick ){
- if( player.Skin != 5 ) return player.Msg("Not the right skin you know?")
- local has_healed = false;
- for( local plr, i = 0; i < 50; i++ ){
- plr = FindPlayer(i);
- if( !plr ) continue;
- local required_distance = 5.0,
- dist_from_player = DistanceFromPoint( player.Pos.x, player.Pos.y, plr.Pos.x, plr.Pos.y );
- if( dist_from_player < required_distance && plr.Health != 100 ){
- player.IncCash(1);
- plr.Health = 100;
- player.Msg("you cured %s, reward: 1$",plr.Name);
- has_healed = true;
- }
- }
- if( !has_healed )player.Msg("No one is near you");
- }
- }
- function CPlayer::IncCash( amount ){
- ::stats[ this.ID ].Cash += amount;
- this.Cash += amount;
- }
- function CPlayer::Msg( text, ... ){
- vargv.insert( 0, this );
- ::MessagePlayer( format.acall(vargv), this );
- }
Add Comment
Please, Sign In to add comment