Jump to content
  • 0

Cashpoint Sender


terrence

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.01
  • Content Count:  18
  • Reputation:   0
  • Joined:  10/23/21
  • Last Seen:  

there have code that gm can send cashpoint to other account using whisper with announcement?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.01
  • Content Count:  18
  • Reputation:   0
  • Joined:  10/23/21
  • Last Seen:  

anyone know or have it?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  109
  • Reputation:   19
  • Joined:  07/28/12
  • Last Seen:  

add this to src/custom/atcommand.inc
 

ACMD_FUNC(gcash)
{
	map_session_data* tsd = nullptr;
	int amount = 0, ret = 0;
	char output[CHAT_SIZE_MAX];
	nullpo_retr(-1,sd);

	memset(atcmd_output, '\0', sizeof(atcmd_output));

	if( sd->state.cashshop_open ){
		clif_displaymessage(fd, msg_txt(sd, 1376)); // Please close the cashshop before using this command.
		return -1;
	}

	if (!message || !*message || sscanf(message, "%11d %23[^\n]", &amount, atcmd_player_name) < 2) {
		clif_displaymessage(fd, "Invalid value (@gcash <amount> <character name>");
		return -1;
	}
	
	if ((tsd = map_nick2sd(atcmd_player_name,false)) == NULL) {
		clif_displaymessage(fd, msg_txt(sd,3)); // Character not found.
		return -1;
	}

	if (sd->cashPoints < amount || amount < 0) {
        clif_displaymessage(fd, "Not enough Cash Points.");
        return -1;
    }
    
	if( (ret=pc_paycash(sd, amount, 0, LOG_TYPE_COMMAND)) >= 0)
	{
		sprintf(output, msg_txt(sd,410), ret, sd->cashPoints); // Removed %d cash points. Total %d points.
		clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF);
	}
		
	if( (ret=pc_getcash(tsd, amount, 0, LOG_TYPE_COMMAND)) >= 0)
	{
		sprintf(output, msg_txt(sd,505), ret, tsd->cashPoints); // Gained %d cash points. Total %d points.
		clif_messagecolor(&tsd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF);
	}

	sprintf(output, "%d players has received '%s'",atcmd_player_name,amount);
	atcommand_broadcast( fd, sd, "@broadcast", output);

    return 0;
}

this to src/custom/atcommand_def.inc


ACMD_DEF(gcash),

this to conf/msg_conf/map_msg.conf

410: Removed %d cash points. Total %d points.
505: Gained %d cash points. Total %d points.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...