viewing paste Unknown #19516 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
ACMD(color) {
    int color = 0;
    int color1;
 
    if(!message || !*message || (!sscanf(message, "%x", &color))) {
        clif->message(fd, "Usage: @color <HEX_COLOR>");
        return false;
    }
    
    if (color > 0xFFFFFF || color < 0) color = 0;
 
    pc_setglobalreg(sd, script->add_str("CHAT_COLOR"), color);
    pc_setglobalreg_str(sd, script->add_str("CHAT_COLOR$"), message);
    sprintf(atcmd_output,"Color has been set to %06X", color);
    clif->message(fd, atcmd_output);
    return true;
}
 
BUILDIN(color2hex) {
    int color = script->get_num(st, 2);
    char *colorstring;
 
    sprintf(colorstring, "Color has been set to %06X", color);
 
    script->push_str(st,
    return true;
}
Viewed 622 times, submitted by Guest.