MuhammadZeeshan

playerstats irc cmd.

Dec 16th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. else if ( cmd == "!playerstats")
  2. {
  3. if ( level < 2 ) EchoNotice1( user, ICOL_RED + "Error - Your level is not high enough to use that command." );
  4. else if ( !text ) EchoNotice1( user, ICOL_RED + " Error - Syntax: " + cmd + " <player name>" );
  5. else
  6. {
  7. local query = QuerySQL( db, "SELECT * FROM Accounts WHERE Name ='" + text + "'" );
  8. if ( GetSQLColumnData( query, 0 ) )
  9. {
  10. local q = QuerySQL( db, "SELECT * FROM lastjoin WHERE Name='" + text + "' COLLATE NOCASE" );
  11. local last_join_time = time() - GetSQLColumnData( q, 1 ).tointeger();
  12. EchoNotice1( user, ICOL_PURPLE + " Name:[ " + text + " ], IP:[ " + GetSQLColumnData( query, 1 ) + " ] Country:[ " + geoip_country_name_by_addr( GetSQLColumnData( query, 1 ) ) + " ], Kills:[ " + GetSQLColumnData( query, 4 ) + " ] Deahts:[ " + GetSQLColumnData( query, 5 ) + " ], Cash:[ $" + GetSQLColumnData( query, 6 ) + " ], Bank:[ $" + GetSQLColumnData( query, 7 ) + " ], Joins:[ " + GetSQLColumnData( query, 8 ) + " ] Registered Date:[ " + GetSQLColumnData( query, 9 ) + " ], VIPLevel:[ " + GetSQLColumnData( query, 12 ) + " ], UID:[ " + GetSQLColumnData( query, 13 ) + " ] Lastactive:[ "+GetTimeFormat( last_join_time )+" ]");
  13. FreeSQLQuery( q );
  14. }
  15. else EchoNotice1( user, ICOL_RED + " Error - " + text + " is not registered." );
  16. FreeSQLQuery( query );
  17. }
  18. }
Add Comment
Please, Sign In to add comment