kalabasa Posted February 11 Share Posted February 11 - script guild_announce -1,{ OnWhisperGlobal: [email protected]_id = getcharid(2); if ( getguildmasterid( [email protected]_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ [email protected]_id, @accountid_member, @charid_member ); [email protected]$ = @whispervar0$; [email protected]$ = strcharinfo(0); [email protected] = getcharid(3); while( [email protected] < @total_guild_member ) { if ( isloggedin( @accountid_member[[email protected]], @charid_member[[email protected]] ) ) { attachrid @accountid_member[[email protected]]; announce "[ "+ [email protected]$ +" ]: "+ [email protected]$, bc_self; attachrid [email protected]; } [email protected]++; } } Quote Link to comment Share on other sites More sharing options...
0 KazumaSatou Posted February 11 Share Posted February 11 1 hour ago, kalabasa said: - script guild_announce -1,{ OnWhisperGlobal: [email protected]_id = getcharid(2); if ( getguildmasterid( [email protected]_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ [email protected]_id, @accountid_member, @charid_member ); [email protected]$ = @whispervar0$; [email protected]$ = strcharinfo(0); [email protected] = getcharid(3); while( [email protected] < @total_guild_member ) { if ( isloggedin( @accountid_member[[email protected]], @charid_member[[email protected]] ) ) { attachrid @accountid_member[[email protected]]; announce "[ "+ [email protected]$ +" ]: "+ [email protected]$, bc_self; attachrid [email protected]; } [email protected]++; } } There is no account_id field on guild_member table. Only char_id is available on guild_mamber table. Or you might wanna add it. Quote Link to comment Share on other sites More sharing options...
0 kalabasa Posted February 11 Author Share Posted February 11 10 minutes ago, KazumaSatou said: There is no account_id field on guild_member table. Only char_id is available on guild_mamber table. Or you might wanna add it. do they have the same value? `account_id` int(11) unsigned NOT NULL default '0', Quote Link to comment Share on other sites More sharing options...
0 KazumaSatou Posted February 11 Share Posted February 11 Just now, kalabasa said: 11 minutes ago, KazumaSatou said: o account_id field on guild_member table. Only char_id is available on guild_mamber table. Or you might wanna add it. do they have the same value? `account_id` int(11) unsigned NOT NULL default '0', Yeah same type. But I think you need to add that in src to make it automatically added the account id once a player joins guild. Quote Link to comment Share on other sites More sharing options...
0 kalabasa Posted February 11 Author Share Posted February 11 i added on mysql workbench. no error but it does not work. i have no idea how to put it on src. Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted March 5 Share Posted March 5 the account_id has been deprecated from the database long time ago, simply adding back the column wont make it work since the column wont have any values stored in it. You have to change the SQL statement to retrieve the info that you needed. @total_guild_member = query_sql( "SELECT `account_id`, `char_id` FROM `char` WHERE `guild_id` = "+ [email protected]_id, @accountid_member, @charid_member ); or a simple attempts - script guild_announce -1,{ OnWhisperGlobal: if (!getcharid(2)) end; .message_owner$ = strcharinfo(0); .message$ = ""; for ([email protected] = 0; [email protected] < 10; [email protected]++) .message$ = .message$ + (([email protected] > 0) ? "#":"") + @whispervar0$; addrid(3, 0, getcharid(2)); announce "[ "+ .message_owner$ +" ]: "+ .message$, bc_self; end; } Quote Link to comment Share on other sites More sharing options...
0 kalabasa Posted May 7 Author Share Posted May 7 On 3/5/2022 at 8:23 PM, Emistry said: the account_id has been deprecated from the database long time ago, simply adding back the column wont make it work since the column wont have any values stored in it. You have to change the SQL statement to retrieve the info that you needed. @total_guild_member = query_sql( "SELECT `account_id`, `char_id` FROM `char` WHERE `guild_id` = "+ [email protected]_id, @accountid_member, @charid_member ); or a simple attempts - script guild_announce -1,{ OnWhisperGlobal: if (!getcharid(2)) end; .message_owner$ = strcharinfo(0); .message$ = ""; for ([email protected] = 0; [email protected] < 10; [email protected]++) .message$ = .message$ + (([email protected] > 0) ? "#":"") + @whispervar0$; addrid(3, 0, getcharid(2)); announce "[ "+ .message_owner$ +" ]: "+ .message$, bc_self; end; } no idea if its working but when i type a message it alway shows ######## Quote Link to comment Share on other sites More sharing options...
- script guild_announce -1,{ OnWhisperGlobal: [email protected]_id = getcharid(2); if ( getguildmasterid( [email protected]_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ [email protected]_id, @accountid_member, @charid_member ); [email protected]$ = @whispervar0$; [email protected]$ = strcharinfo(0); [email protected] = getcharid(3); while( [email protected] < @total_guild_member ) { if ( isloggedin( @accountid_member[[email protected]], @charid_member[[email protected]] ) ) { attachrid @accountid_member[[email protected]]; announce "[ "+ [email protected]$ +" ]: "+ [email protected]$, bc_self; attachrid [email protected]; } [email protected]++; } }Link to comment
Share on other sites