viewing paste Unknown #214 | 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 28 29 30 31 32 33 34
/**
 * block (<type> {, <duration> }) -> Blocks everything except talking. [Masao]
 * <type> : 0  = disabled, 1 = enabled.
 * <duration> : Duration in milliseconds.
 **/
BUILDIN_FUNC(block) {
 
    unsigned int type = 0, duration = 0;
    TBL_PC *sd;
 
    if( (sd = script_rid2sd(st)) == NULL )
        return 0;
 
    if( script_hasdata(st,2) )
    {
        type = script_getnum(st,2);
 
        if( type > 1 )
        {
            ShowError("buildin_showdigit: Invalid type!");
            return 1;
        }
    }
 
    if( script_hasdata(st,3) )
        duration = 1000 * script_getnum(st,3);
 
    switch(type){
        case 1: ; // Block usage of skills, items and walking.
        default: ; // Enables usage of skills, items and walking.
    }
 
    return 0;
}
Viewed 888 times, submitted by Guest.