Files
CHOMPStation2/code/game/verbs/checkkarma.dm
rastaf.zero@gmail.com ef23794506 Fixed runtime error with changeling gibbed by alium larva.
Added sanitize() to naming the buffers in DNA machine and to alien whispering.
Added 0.5 sec timeout for BANG BANG.
Added drinking glasses to the Dinnerware vending machine.
Update from Nikie:
Verb Reload Admins rereads admins.txt
Parameter sql_enabled in config. Prevents spam when sql is not installed.
NOTE FOR HOSTERS: it is currently ON in code (i.e. behavior is unchanged yet), you have to add SQL_ENABLED to your config.txt during next week. Thanks for your attention.
Fixed "Delay" command.
Messages for help intent are gender-aware now.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1463 316c924e-a436-60f5-8080-3fe189b3f50e
2011-04-17 18:09:30 +00:00

26 lines
936 B
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
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>"