Files
vgstation13/code/unused/checkkarma.dm
mport2004@gmail.com c86c8e1505 Finished moving the clothes in defines over to modules.
Several head objects path changed so they are not helmets, head means can fit on your head, helmet was securities helmets, space helmets currently still helmet.
Cult restricted job list now has the sec force + cap because you can’t convert them as is.
AI removed from protected traitor jobs as malf is currently effectively out of commission.
A Protected list was added to changling.
Removed the furry mob files that were not checked.
Moved two unchecked files to unused


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3896 316c924e-a436-60f5-8080-3fe189b3f50e
2012-06-23 19:25:01 +00:00

29 lines
1.0 KiB
Plaintext

/mob/verb/check_karma()
set name = "Check Karma"
set category = "Special Verbs"
set desc = "Reports how much karma you have accrued"
if(config.sql_enabled)
var/DBConnection/dbcon = new()
dbcon.Connect("dbi:mysql:[sqldb]:[sqladdress]:[sqlport]","[sqllogin]","[sqlpass]")
if(!dbcon.IsConnected())
usr << "\red Unable to connect to karma database. This error can occur if your host has failed to set up an SQL database or improperly configured its login credentials.<br>"
return
else
usr.verbs -= /mob/verb/check_karma
spawn(300)
usr.verbs += /mob/verb/check_karma
var/DBQuery/query = dbcon.NewQuery("SELECT karma FROM karmatotals WHERE byondkey='[src.key]'")
query.Execute()
var/currentkarma
while(query.NextRow())
currentkarma = query.item[1]
if(currentkarma)
usr << "<b>Your current karma is:</b> [currentkarma]<br>"
else
usr << "<b>Your current karma is:</b> 0<br>"
dbcon.Disconnect()
else
usr << "<b>SQL is off, karma is not usable<b>"