BUILDIN(setcolor){ int color = script_getnum(st, 2); char colorstring[7]; snprintf(colorstring, 7, "%06X", color); script_pushstrcopy(st, colorstring); pc_setglobalreg(sd,script->add_str("CHAT_COLOR"),colorstring); return true; }