Jump to content
  • 0

kill/disconnect someone from SQL?


Noturn

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   1
  • Joined:  11/18/13
  • Last Seen:  

Hey people,

 

I have just one doubt, anyone know if it's possible to kill/disconnect someone using sql tables?

 

thanks. :)

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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` table

and the buffs is `sc_data`

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you mean IP Ban List?

 

or

 

loop through a custom SQL table for table

then get the data and disconnect/kill thee characters ?

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   1
  • Joined:  11/18/13
  • Last Seen:  

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.

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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.

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   1
  • Joined:  11/18/13
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   1
  • Joined:  11/18/13
  • Last Seen:  

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` table

and the buffs is `sc_data`

 

 

Thanks lady AnnieRuru. I really appreciate your job.

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