Jump to content
  • 0

Mail Request !


Vince Jimenez

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  68
  • Reputation:   1
  • Joined:  10/16/12
  • Last Seen:  

Hellow Guys !!!  can i request a gm script commands ?


Only gm lvl 99 can use

@mailall -<idname><Amount> and all players online will receive a mail from me?

Example:
@mailall 607 20


@guildmail - <idname><Amount><guildname>  guild chose will be mail ?

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


- script atcmd_mail -1,{

OnInit:

bindatcmd "mailall",strnpcinfo(3)+"::OnMailall",99,99;

bindatcmd "guildmail",strnpcinfo(3)+"::OnGuildmail",99,99;

end;

OnMailall:

.name$ = strcharinfo(0);

if ( getiteminfo( atoi( .@atcmd_parameters$[0] ),0 ) == -1 ) {

message .name$, "invalid item id";

end;

}

if ( atoi( .@atcmd_parameters$[1] ) < 1 )

.@atcmd_parameters$[1] = "1";

query_sql( "INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) select "+

"'no-reply',"+

"`char_id`"+

",'GM reward',"+

"'You got a mail from "+ .name$ +"',"+

.@atcmd_parameters$[0] +","+ .@atcmd_parameters$[1] +",0,0,UNIX_TIMESTAMP(NOW()) from `char` where online = 1 and char_id != "+ getcharid(0) );

addrid 0;

if ( strcharinfo(0) != .name$ )

message strcharinfo(0), "You got a mail from "+ .name$;

end;

OnGuildmail:

.name$ = strcharinfo(0);

if ( getiteminfo( atoi( .@atcmd_parameters$[0] ),0 ) == -1 ) {

message .name$, "invalid item id";

end;

}

if ( atoi( .@atcmd_parameters$[1] ) < 1 )

.@atcmd_parameters$[1] = "1";

query_sql "select guild_id from guild where name = '"+ escape_sql( .@atcmd_parameters$[2] ) +"'", .@guild_id;

if ( .@guild_id == 0 ) {

message .name$, "wrong guild name";

end;

}

query_sql( "INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) select "+

"'no-reply',"+

"`char`.`char_id`"+

",'GM reward',"+

"'You got a mail from "+ .name$ +"',"+

.@atcmd_parameters$[0] +","+ .@atcmd_parameters$[1] +",0,0,UNIX_TIMESTAMP(NOW()) from `char` "+

"where guild_id = "+ .@guild_id +" and online = 1 and char_id != "+ getcharid(0) );

addrid 3,0, .@guild_id;

if ( strcharinfo(0) != .name$ )

message strcharinfo(0), "You got a mail from "+ .name$;

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

You can try searching for a similar thread like that in the forums.

 

I'll try to give you an idea..

 

You can achieve this also by executing an SQL query on your database.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  68
  • Reputation:   1
  • Joined:  10/16/12
  • Last Seen:  

-	script	atcmd_mail	-1,{
OnInit:
	bindatcmd "mailall",strnpcinfo(3)+"::OnMailall",99,99;
	bindatcmd "guildmail",strnpcinfo(3)+"::OnGuildmail",99,99;
	end;
OnMailall:
	.name$ = strcharinfo(0);
	if ( getiteminfo( atoi( .@atcmd_parameters$[0] ),0 ) == -1 ) {
		message .name$, "invalid item id";
		end;
	}
	if ( atoi( .@atcmd_parameters$[1] ) < 1 )
		.@atcmd_parameters$[1] = "1";
	query_sql( "INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) select "+
		  "'no-reply',"+
		  "`char_id`"+
		  ",'GM reward',"+
		  "'You got a mail from "+ .name$ +"',"+
		  .@atcmd_parameters$[0] +","+ .@atcmd_parameters$[1] +",0,0,UNIX_TIMESTAMP(NOW()) from `char` where online = 1 and char_id != "+ getcharid(0) );
	addrid 0;
	if ( strcharinfo(0) != .name$ )
		message strcharinfo(0), "You got a mail from "+ .name$;
	end;
OnGuildmail:
	.name$ = strcharinfo(0);
	if ( getiteminfo( atoi( .@atcmd_parameters$[0] ),0 ) == -1 ) {
		message .name$, "invalid item id";
		end;
	}
	if ( atoi( .@atcmd_parameters$[1] ) < 1 )
		.@atcmd_parameters$[1] = "1";
	query_sql "select guild_id from guild where name = '"+ escape_sql( .@atcmd_parameters$[2] ) +"'", .@guild_id;
	if ( .@guild_id == 0 ) {
		message .name$, "wrong guild name";
		end;
	}
	query_sql( "INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) select "+
		  "'no-reply',"+
		  "`char`.`char_id`"+
		  ",'GM reward',"+
		  "'You got a mail from "+ .name$ +"',"+
		  .@atcmd_parameters$[0] +","+ .@atcmd_parameters$[1] +",0,0,UNIX_TIMESTAMP(NOW()) from `char` "+
		"where guild_id = "+ .@guild_id +" and online = 1 and char_id != "+ getcharid(0) );
	addrid 3,0, .@guild_id;
	if ( strcharinfo(0) != .name$ )
		message strcharinfo(0), "You got a mail from "+ .name$;
	end;
}

Hi sir,

i got a problem @mailall is working but once my player Opened their mail no items :(

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

It seems working for me. I got the mail and the item in the mail. The player of the guild must be online for @guildmail and the player must relog to see the mail

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  68
  • Reputation:   1
  • Joined:  10/16/12
  • Last Seen:  

its working thanks a lot men !!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  208
  • Reputation:   1
  • Joined:  01/06/12
  • Last Seen:  

what if auto mail like after the LMS event winner will have reward via mail?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

what if auto mail like after the LMS event winner will have reward via mail?

Possible. Include the query about the mail at the end of your event script

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  58
  • Topics Per Day:  0.01
  • Content Count:  208
  • Reputation:   1
  • Joined:  01/06/12
  • Last Seen:  

how to include the quest to event? can you give example? thanks :D

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...