|
@@ -906,6 +906,54 @@ int charcommand_zeny(const int fd, struct map_session_data* sd, const char* comm
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/*==========================================
|
|
|
+ * #cash or #points <amount> <charname>
|
|
|
+ *------------------------------------------*/
|
|
|
+int charcommand_cash(const int fd, struct map_session_data* sd, const char* command, const char* message)
|
|
|
+{
|
|
|
+ struct map_session_data *pl_sd;
|
|
|
+ char character[NAME_LENGTH];
|
|
|
+ int value = 0;
|
|
|
+ nullpo_retr(-1, sd);
|
|
|
+
|
|
|
+ memset(character, '\0', sizeof(character));
|
|
|
+
|
|
|
+ if( !message || !*message || sscanf(message, "%d %23[^\n]", &value, character) < 2 || value == 0 )
|
|
|
+ {
|
|
|
+ clif_displaymessage(fd, "Please, enter a number and a player name (usage: #cash|#points <points> <name>).");
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if( (pl_sd = map_nick2sd(character)) != NULL )
|
|
|
+ {
|
|
|
+ if( !strcmpi(command+1,"cash") )
|
|
|
+ {
|
|
|
+ if( value > 0 )
|
|
|
+ pc_getcash(pl_sd, value, 0);
|
|
|
+ else
|
|
|
+ pc_paycash(pl_sd, value, 0);
|
|
|
+
|
|
|
+ clif_displaymessage(fd, "Character's Cash Points changed!.");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ { // @points
|
|
|
+ if( value > 0 )
|
|
|
+ pc_getcash(pl_sd, 0, value);
|
|
|
+ else
|
|
|
+ pc_paycash(pl_sd, value, value);
|
|
|
+
|
|
|
+ clif_displaymessage(fd, "Character's Kafra Points changed!.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ clif_displaymessage(fd, msg_txt(3)); // Character not found.
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
/*==========================================
|
|
|
* #fakename <char name> <fake name>
|
|
|
*------------------------------------------*/
|
|
@@ -3739,6 +3787,8 @@ CharCommandInfo charcommand_info[] = {
|
|
|
{ "homfriendly", 60, charcommand_homfriendly },
|
|
|
{ "homhungry", 60, charcommand_homhungry },
|
|
|
{ "hominfo", 40, charcommand_hominfo },
|
|
|
+ { "cash", 60, charcommand_cash },
|
|
|
+ { "points", 60, charcommand_cash },
|
|
|
};
|
|
|
|
|
|
|