Mabuhay Posted July 20, 2013 Posted July 20, 2013 the title says it. a script that will make a broadcast announcement for guild mem on a guild only. thanks :3 Quote
Capuche Posted July 21, 2013 Posted July 21, 2013 - script guild_announce -1,{ OnWhisperGlobal: .@guild_id = getcharid(2); if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member ); .@mes$ = @whispervar0$; .@name$ = strcharinfo(0); .@origin = getcharid(3); while( .@i < @total_guild_member ) { if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) { attachrid @accountid_member[.@i]; announce "[ "+ .@name$ +" ]: "+ .@mes$, bc_self; attachrid .@origin; } .@i++; } } I tested it, should work now Quote
Capuche Posted July 20, 2013 Posted July 20, 2013 There is already a guild chat.. I don't get the benefit of this npc Quote
Patskie Posted July 20, 2013 Posted July 20, 2013 Or if you want -> http://rathena.org/board/topic/66721-inds-handy-guild-commands-ea-ra-port/ 1 Quote
Mabuhay Posted July 21, 2013 Author Posted July 21, 2013 There is already a guild chat.. I don't get the benefit of this npc with this function, the guild leader can announce/broadcast to the members and members will read the guild leader's command easily. Or if you want -> http://rathena.org/board/topic/66721-inds-handy-guild-commands-ea-ra-port/ Thanks patskie! will try this soon. Quote
Capuche Posted July 21, 2013 Posted July 21, 2013 Alright ! well I made one for fun but it's less efficient than source mod - script guild_announce -1,{ OnWhisperGlobal: .@guild_id = getcharid(2); if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member ); .@mes$ = @whispervar0$; .@name$ = strcharinfo(0); while( .@i < @total_guild_member ) { if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) { attachrid @accountid_member[.@i]; announce "[ "+ .@name$ +" ]: "+ .@mes$, bc_self; } .@i++; } } The guild leader need to whisper the npc guild_announce and put his message. The npc display the announce to all guild member online without delay EDIT : fix a mistake 1 Quote
Mabuhay Posted July 21, 2013 Author Posted July 21, 2013 (edited) Alright ! well I made one for fun but it's less efficient than source mod - script guild_announce -1,{ OnWhisperGlobal: .@guild_id = getcharid(2); if ( getguildmasterid( .@guild_id ) == 0 ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member ); .@mes$ = @whispervar0$; .@name$ = strcharinfo(0); while( .@i < @total_guild_member ) { if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) { attachrid @accountid_member[.@i]; announce "[ "+ .@name$ +" ]: "+ .@mes$, 0; } .@i++; } } The guild leader need to whisper the npc guild_announce and put his message. The npc display the announce to all guild member online This is what im looking for!! weeeeeee no src mod. THanks Capuche! PS: Bugged, it announce to all, not exclusive on guild mems only Edited July 21, 2013 by MrVandalBus Quote
Capuche Posted July 21, 2013 Posted July 21, 2013 oops replace the 0 by bc_self in the announce Quote
Mabuhay Posted July 21, 2013 Author Posted July 21, 2013 (edited) Fixed Edited July 21, 2013 by MrVandalBus Quote
Capuche Posted July 21, 2013 Posted July 21, 2013 oO alright but replace the getguildmasterid line by if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end; otherwise other member can broadcast too Quote
Mabuhay Posted July 21, 2013 Author Posted July 21, 2013 woopsies. some more problems. only one member can see the announcement, the rest cant @_@ event the leader himself cant see his msg. Quote
uDe Posted July 22, 2013 Posted July 22, 2013 (edited) Hello, I found this was very useful. But when I'm test the script form post #11 , I'll just announce to my self.. Other guild member can't receive any message. Here's the screen shot : Thanks for the idea. EDIT : It's working after server restart. Thank you very much for this. Edited July 22, 2013 by uDe Quote
Capuche Posted July 22, 2013 Posted July 22, 2013 I guess you tested with a new guild member. The new member must relog to save the data in guild member database (otherwise he doesn't exist yet) and the guild leader must relog too to update his guild member temporary variables. resume when you invite a new member : new guild member must relog guild leader relog Quote
uDe Posted July 22, 2013 Posted July 22, 2013 I guess you tested with a new guild member. The new member must relog to save the data in guild member database (otherwise he doesn't exist yet) and the guild leader must relog too to update his guild member temporary variables. resume when you invite a new member : new guild member must relog guild leader relog Yes, I've tried it using a new member. But, I've relog too. Still can't view the message. It's working after server restart. Thank you very much for this. Edited by uDe, Today, 11:25 AM. Quote
Question
Mabuhay
the title says it. a script that will make a broadcast announcement for guild mem on a guild only.
thanks :3
13 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.