View Single Post
  #2  
Old 03-31-2002, 05:32 PM
Cybnext_Design Cybnext_Design is offline
Registered User
Join Date: Jun 2001
Posts: 244
Cybnext_Design is on a distinguished road
Send a message via AIM to Cybnext_Design
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.warrior))/strtofloat(#s(server.people));
tokenize #c;
if (strequals(#t(1),warrior)) {
if (this.warrior>0.3) {
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;
}



This should work how you want it to.
__________________
Graal2001 NPC Maker
Frolic Owner
Aim: C Y B N E X T
Reply With Quote