View Single Post
  #1  
Old 03-31-2002, 05:12 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Class Equilization

OK, this is an NPC I am working on for Eternal Destiny so please dont steal it. I would like to know some things i could do to make it better plus any tips to get it to work right.
NPC Code:

NPC Code:

// NPC made by Nyght
// Class Equilization
if (playerenters&&!joined) {
set joined;
setstring server.people,#v(strtofloat(#s(server.people))+=1) ;
}
if (playerchats&&startswith(joinclass,#c)) {
this.warrior=strtofloat(#s(server.people))*.30;
tokenize #c;
if (strequals(#t(1),warrior)) {
if (this.warrior<strtofloat(#s(server.warrior))) {
message You can not choose this class because it allready has enough participants!;
sleep 1.25;
message ;
} else {
joinclasswarrior();
}
}
message If you are not transfered to class level, check spelling and try again!;
}
// Functions
function joinclasswarrior() {
set warriorclass;
setstring server.warrior,#v(strtofloat(#s(server.warrior))+= 1);
setlevel2 warrior.graal,32,32;
}




Its rougly suppose to work out like, if the warrior class is less then 30% of the servers total population then the person can join the class ...

Please, any help is appreciated ...
Reply With Quote