Noturn Posted December 5, 2015 Posted December 5, 2015 Hey people, I have just one doubt, anyone know if it's possible to kill/disconnect someone using sql tables? thanks. Quote
0 AnnieRuru Posted December 8, 2015 Posted December 8, 2015 yes, you can do some sort of trick, though, running query_sql repeatedly might eats your server resources I don't really recommend though - script kdhfksfjs FAKE_NPC,{ OnInit: query_sql "create table if not exists disconnect_char( account_id int(11) primary key, char_id int(11), name varchar(23) ) engine = innodb;"; while ( true ) { .@nb = query_sql( "select * from disconnect_char", .@aid, .@cid, .@name$ ); for ( .@i = 0; .@i < .@nb; .@i++ ) { if ( .@aid[.@i] ) { if ( isloggedin( .@aid[.@i] ) ) { atcommand "@kick "+ rid2name( .@aid[.@i] ); debugmes "the player AID "+ .@aid[.@i] +" has been kick."; } else debugmes "the player AID "+ .@aid[.@i] +" is not online"; query_sql "delete from disconnect_char where account_id = "+ .@aid[.@i]; } else if ( .@cid[.@i] ) { if ( query_sql( "select account_id from `char` where char_id = "+ .@cid[.@i], .@taid ) ) { if ( isloggedin( .@taid ) ) { atcommand "@kick "+ rid2name( .@taid ); debugmes "the player CID "+ .@cid[.@i] +" has been kick."; } else debugmes "the player CID "+ .@cid[.@i] +" is not online"; } else debugmes "the player CID "+ .@cid[.@i] +" doesn't exist"; query_sql "delete from disconnect_char where char_id = "+ .@cid[.@i]; } else if ( .@name$[.@i] ) { if ( query_sql( "select account_id from `char` where name = '"+ escape_sql(.@name$[.@i]) +"'", .@taid ) ) { if ( isloggedin( .@taid ) ) { atcommand "@kick "+ rid2name( .@taid ); debugmes "the player name "+ .@name$[.@i] +" has been kick."; } else debugmes "the player name "+ .@name$[.@i] +" is not online"; } else debugmes "the player name "+ .@name$[.@i] +" doesn't exist"; query_sql "delete from disconnect_char where name = '"+ escape_sql(.@name$[.@i]) +"'"; } } sleep 5000; } }.. One last question, Do you know where I can find the sql to see the autotrade players? or any sql to see the buffs from each player. Or it's a kind of custom table?its inside `vendings` tableand the buffs is `sc_data` 1 Quote
0 Emistry Posted December 5, 2015 Posted December 5, 2015 you mean IP Ban List? or loop through a custom SQL table for table then get the data and disconnect/kill thee characters ? 1 Quote
0 Noturn Posted December 6, 2015 Author Posted December 6, 2015 you mean IP Ban List? or loop through a custom SQL table for table then get the data and disconnect/kill thee characters ? No, I mean a custom table that will just disconnect the players, if theres someway to do it, can you help me? Just disconnect someone via sql, even players with autotrade. Thanks sir Emistry. Quote
0 Emistry Posted December 6, 2015 Posted December 6, 2015 SQL Table is used to store data, it doesnt execute out any command to interfere with the game. The part that executing the command to kick players is the NPC Script or the Source Modication. If this is a NPC script that you're looking for, you shall elaborate how the NPC script should work to disconnect the users. 1 Quote
0 Noturn Posted December 7, 2015 Author Posted December 7, 2015 SQL Table is used to store data, it doesnt execute out any command to interfere with the game. The part that executing the command to kick players is the NPC Script or the Source Modication. If this is a NPC script that you're looking for, you shall elaborate how the NPC script should work to disconnect the users. Thanks sir Emirtry, I understand that SQL can't interfere directly with the game. So I should use npc+sql to make it work. One last question, Do you know where I can find the sql to see the autotrade players? or any sql to see the buffs from each player. Or it's a kind of custom table? Thanks again. Quote
0 Noturn Posted December 11, 2015 Author Posted December 11, 2015 yes, you can do some sort of trick, though, running query_sql repeatedly might eats your server resources I don't really recommend though - script kdhfksfjs FAKE_NPC,{ OnInit: query_sql "create table if not exists disconnect_char( account_id int(11) primary key, char_id int(11), name varchar(23) ) engine = innodb;"; while ( true ) { .@nb = query_sql( "select * from disconnect_char", .@aid, .@cid, .@name$ ); for ( .@i = 0; .@i < .@nb; .@i++ ) { if ( .@aid[.@i] ) { if ( isloggedin( .@aid[.@i] ) ) { atcommand "@kick "+ rid2name( .@aid[.@i] ); debugmes "the player AID "+ .@aid[.@i] +" has been kick."; } else debugmes "the player AID "+ .@aid[.@i] +" is not online"; query_sql "delete from disconnect_char where account_id = "+ .@aid[.@i]; } else if ( .@cid[.@i] ) { if ( query_sql( "select account_id from `char` where char_id = "+ .@cid[.@i], .@taid ) ) { if ( isloggedin( .@taid ) ) { atcommand "@kick "+ rid2name( .@taid ); debugmes "the player CID "+ .@cid[.@i] +" has been kick."; } else debugmes "the player CID "+ .@cid[.@i] +" is not online"; } else debugmes "the player CID "+ .@cid[.@i] +" doesn't exist"; query_sql "delete from disconnect_char where char_id = "+ .@cid[.@i]; } else if ( .@name$[.@i] ) { if ( query_sql( "select account_id from `char` where name = '"+ escape_sql(.@name$[.@i]) +"'", .@taid ) ) { if ( isloggedin( .@taid ) ) { atcommand "@kick "+ rid2name( .@taid ); debugmes "the player name "+ .@name$[.@i] +" has been kick."; } else debugmes "the player name "+ .@name$[.@i] +" is not online"; } else debugmes "the player name "+ .@name$[.@i] +" doesn't exist"; query_sql "delete from disconnect_char where name = '"+ escape_sql(.@name$[.@i]) +"'"; } } sleep 5000; } }.. One last question, Do you know where I can find the sql to see the autotrade players? or any sql to see the buffs from each player. Or it's a kind of custom table?its inside `vendings` tableand the buffs is `sc_data` Thanks lady AnnieRuru. I really appreciate your job. Quote
Question
Noturn
Hey people,
I have just one doubt, anyone know if it's possible to kill/disconnect someone using sql tables?
thanks.
6 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.