Jump to content
  • 0

Question

13 answers to this question

Recommended Posts

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

Posted

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
Posted (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 by MrVandalBus
Posted

oO alright but replace the getguildmasterid line by

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

otherwise other member can broadcast too

Posted (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 :

 

ilRRa8c.png

 

Thanks for the idea.

 

EDIT :

 

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

Edited by uDe
Posted

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
Posted

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.

                            

                       

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...