Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sqlite3
- import es
- db = '/home/cstrike/Website/cattes/cattes.db'
- def load():
- if not es.exists('clientcommand', 'cattes_auth'):
- es.regclientcmd('cattes_auth', 'auth/auth_player', 'Authorizes you. Duh.')
- def unload():
- if es.exists('clientcommand', 'cattes_auth'):
- es.unregclientcmd('cattes_auth')
- def auth_player():
- userid = es.getcmduserid()
- steamid = es.getplayersteamid(userid)
- authCode = es.getargv(1)
- steamgay = "".join(steamid)
- conn = sqlite3.connect(db)
- curs = conn.cursor()
- curs2 = conn.cursor()
- curs.execute("SELECT authcode FROM auth_cattesuser WHERE steam_id = ?", steamgay)
- if authCode == curs:
- es.cexec(userid,"echo You are now registered! Congrats!")
- curs2.execute("UPDATE auth_cattesuser SET access_level=1 WHERE steam_id = ?", steamgay)
- else:
- es.cexec(userid,"echo Not a valid code. Please try again.")
- conn.commit()
- curs.close()
- curs2.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement