viewing paste acmd_zone | 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
ACMD_FUNC(zone){
        char zone[6] = "zone\0";
        char empty[1] = "\0";
        char zonename[MAP_ZONE_MAPFLAG_LENGTH];
        struct map_zone_data *zd;
 
        if (!message || !*message || (sscanf(message, "%49s", zonename) < 1)) {
            sprintf(atcmd_output,"usage @zone \"zonename\" ");
            clif_displaymessage(sd->fd,atcmd_output);
            return -1;
        }
 
        if( !(zd = strdb_get(zone_db, zonename)) ) {
            sprintf(atcmd_output,"[ zone ] invalide zonename = %s",zonename);
            clif_displaymessage(sd->fd,atcmd_output);
            return -2;
        }
 
        npc_parse_mapflag(map[sd->bl.m].name, empty, zone, zonename, empty, empty, empty);
        sprintf(atcmd_output,"[ zone ] = %s has been applyed to map",zonename);
        clif_displaymessage(sd->fd,atcmd_output);
        return 0;
}
Viewed 560 times, submitted by lighta.