lightme.c

ds2.10/lib/cmds/creators/lightme.c · 687 B

From the archive ds2.10.zip

Download the archive   « Back to the archive contents

#include <lib.h>

inherit LIB_COMMAND;

int cmd(string str){
    int level;
    if(!str){
        write("Your current radiant light is: "+this_player()->GetRadiantLight()+".");
        return 1;
    }
    if(sscanf(str,"%d",level) != 1){
        write("Please specify a numerical light level.");
        return 1;
    }
    if(level < 0 || level > 100){
        write("Please enter a light level between 0 and 100");
        return 1;
    }
    this_player()->SetRadiantLight(level);
    write("Your current radiant light is: "+this_player()->GetRadiantLight()+".");
    return 1;
}

string GetHelp(string str){
    return "Reports or changes the amount of light your body radiates.";
}

Site Stats

Snippets: 1791
Codebases: 571