Vince Jimenez Posted April 23, 2014 Posted April 23, 2014 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 ? Quote
Capuche Posted April 24, 2014 Posted April 24, 2014 - 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; } Quote
sandbox Posted April 24, 2014 Posted April 24, 2014 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. Quote
Vince Jimenez Posted April 25, 2014 Author Posted April 25, 2014 - 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 Quote
Aksl Posted April 26, 2014 Posted April 26, 2014 Maybe you could use a npc : Look this script command Quote
Capuche Posted April 26, 2014 Posted April 26, 2014 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 Quote
Vince Jimenez Posted April 27, 2014 Author Posted April 27, 2014 its working thanks a lot men !!! Quote
Blazing Spear Posted April 27, 2014 Posted April 27, 2014 what if auto mail like after the LMS event winner will have reward via mail? Quote
Capuche Posted April 27, 2014 Posted April 27, 2014 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 Quote
Blazing Spear Posted April 28, 2014 Posted April 28, 2014 how to include the quest to event? can you give example? thanks Quote
Question
Vince Jimenez
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 ?
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.