Jump to content
  • 0

Guild broadcast


Mabuhay

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

the title says it. a script that will make a broadcast announcement for guild mem on a guild only.

 

thanks :3

Link to comment
Share on other sites

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

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:  

There is already a guild chat.. I don't get the benefit of this npc

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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.

 

 

Thanks patskie! will try this soon.

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:  

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

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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 by MrVandalBus
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:  

oops replace the 0 by bc_self in the announce

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Fixed :P

Edited by MrVandalBus
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:  

oO alright but replace the getguildmasterid line by

if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end;

otherwise other member can broadcast too

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

woopsies. some more problems. only one member can see the announcement, the rest cant @_@

event the leader himself cant see his msg.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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 :

 

ilRRa8c.png

 

Thanks for the idea.

 

EDIT :

 

It's working after server restart. Thank you very much for this.

Edited by uDe
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:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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.

                            

                       

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