diff options
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 5c3fb80a3..f2947372b 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7966,6 +7966,37 @@ int atcommand_reject(const int fd, struct map_session_data* sd, const char* comm } /*=================================== + * Cash Points + *-----------------------------------*/ +int atcommand_cash(const int fd, struct map_session_data* sd, const char* command, const char* message) +{ + int value; + nullpo_retr(-1, sd); + + if( !message || !*message || (value = atoi(message)) == 0 ) { + clif_displaymessage(fd, "Please, enter an amount."); + return -1; + } + + if( !strcmpi(command+1,"cash") ) + { + if( value > 0 ) + pc_getcash(sd, value, 0); + else + pc_paycash(sd, value, 0); + } + else + { // @points + if( value > 0 ) + pc_getcash(sd, 0, value); + else + pc_paycash(sd, value, value); + } + + return 0; +} + +/*=================================== * Away message (@away, @aw) [LuzZza] *-----------------------------------*/ int atcommand_away(const int fd, struct map_session_data* sd, const char* command, const char* message) @@ -8481,6 +8512,8 @@ AtCommandInfo atcommand_info[] = { { "mail", 1, atcommand_mail }, { "noks", 0, atcommand_ksprotection }, { "allowks", 6, atcommand_allowks }, + { "cash", 60, atcommand_cash }, + { "points", 60, atcommand_cash }, }; |