Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » BrenBot Refund Command (For people that use BrenBot still.)
BrenBot Refund Command [message #471581] Fri, 13 July 2012 09:51 Go to previous message
Distrbd21 is currently offline  Distrbd21
Messages: 743
Registered: September 2008
Karma:
Colonel

I decided to fix the !refund command on BrenBot, it now will give the player the credits instead of just saying it did.

I also added !defund so you can take a players credits.

EDIT: Also fixed the double was typo ;p

Requirements
BrenBot: Of course
ExtraConsoleCommands Plugin: The Commands use GiveCredits and TakeCredits, only available with the plugin.

All I did was edit the pm and xml files to the following.

!refund
sub refund
{
	my ( $kernel, $session, $heap, $args ) = @_[ KERNEL, SESSION, HEAP, ARG0 ];
	my %args = %{$args};

	if ($args{arg1} && $args{arg2}  && ($args{arg2} =~ m/^(-?\d+)$/ ))
	{
	my ( $result, %player ) = playerData::getPlayerData( $args{'arg1'} );
	if ( $result == 1 )
	{
        my $amount = $args{arg2};

	plugin::RenRemCMD ( "GiveCredits $player{id} $amount" );
        plugin::RenRemCMD("ppage $player{id}  you have been giving $amount credits by $args{nick}.");
        plugin::ircmsg ( " $player{name} was refunded $amount credits by $args{nick}", A);
	}
        else {
        doMsg("Error: $args{arg1} was not found ingame, or is not unique",$args{nicktype}, "A");
        }
       }
       else
       {
        doMsg("Syntax: !refund <player> <amount>",$args{nicktype}, "A");
   }
}

!defund
sub defund
{
	my ( $kernel, $session, $heap, $args ) = @_[ KERNEL, SESSION, HEAP, ARG0 ];
	my %args = %{$args};

	if ($args{arg1} && $args{arg2}  && ($args{arg2} =~ m/^(-?\d+)$/ ))
	{
	my ( $result, %player ) = playerData::getPlayerData( $args{'arg1'} );
	if ( $result == 1 )
	{
        my $amount = $args{arg2};

	plugin::RenRemCMD ( "TakeCredits $player{id} $amount" );
        plugin::RenRemCMD("ppage $player{id}  $args{nick} has taken $amount credits from you.");
        plugin::ircmsg ( " $player{name} was defunded $amount credits by $args{nick}", A);
	}
        else {
        doMsg("Error: $args{arg1} was not found ingame, or is not unique",$args{nicktype}, "A");
        }
       }
       else
       {
        doMsg("Syntax: !defund <player> <amount>",$args{nicktype}, "A");
   }
}
  • Attachment: BRenBot.pm
    (Size: 6.97KB, Downloaded 102 times)
  • Attachment: BRenBot.xml
    (Size: 2.41KB, Downloaded 89 times)


Live Your Life Not Some one Else's.| Sharing Is Caring

http://dsgaming.us/distrbd21/Distrbd21%20siggy.png

Cookie Jar

Suicide

[Updated on: Fri, 13 July 2012 09:57]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SSGM 4.0 Plugin] Beacon Mute
Next Topic: [SSGM 4.0 Plugin] Range and RoF Cheat Detection
Goto Forum:
  


Current Time: Mon Nov 18 03:55:36 MST 2024

Total time taken to generate the page: 0.00668 seconds