//johndoe @ gooeymud #include #include #include int disp(string name, string hp, string mhp, string sp, string msp, int lvl, string race,int x); int cmd_whobe(string str) { int i, x = 0; object *usrs = users(); write(" Name Race Hit points Spellpoints Level\n"); write(" ---- ---- ---------- ----------- -----\n"); //spacing 1) ashke human (465/492) (0/0) (29) for(i = 0; i <= sizeof(users())-1; i++) { string name = usrs[i]->query("name"); string race = usrs[i]->query("race"); string hp = ""+(string)usrs[i]->query("hit_points"); string mhp = ""+(string)usrs[i]->query("max_hp"); string sp = ""+(string)usrs[i]->query("spell_points"); string msp = ""+(string)usrs[i]->query("max_sp"); int lvl = usrs[i]->query("level"); int exp = usrs[i]->query("level"); int mexp = usrs[i]->query("experience"); x++; disp(name, hp, mhp, sp, msp, lvl, race, x); } return 1; } int disp(string name, string hp, string mhp, string sp, string msp, int lvl, string race,int x) { string temp; // Number write("\t"+x+") "); // Name if(sizeof(name) < 4){ temp="\t\t";} else{temp = "\t";} write(name+temp); // Race if(sizeof(race) < 4){ temp="\t\t";} else{temp = "\t";} write("%^BLUE%^"+race+"%^RESET%^"+temp); // Hit points if(atoi(hp) < 100){ temp="\t\t";} else{ temp="\t";} write("(%^RED%^"+hp+"/"+mhp+"%^RESET%^)"+temp); // Spell points if(atoi(sp) < 100){ temp="\t\t";} else{ temp="\t";} write("(%^CYAN%^"+sp+"/"+msp+"%^RESET%^)"+temp); // Level write(lvl); write("\n"); return 1; }