Yes, my previous topic was over my clan topic's values, they work now, but now I dont understand how to fix my promotion system... Can someone help me?
PHP Code:
function onActionServerside(){
if(params[0] == "add"){
this.clan = clientr.clan;
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
pl.clientr.clan.add(this.clan);
pl.clientr.position.add("0");
pl.clientr.position ="Recruit";
pl.clientr.clan ="Forbidden Gladiators";
pl.addweapon("Public/Struggler/ClanTag");
pl.chat = "You have been added to clan: "@this.clan;
} else{
player.chat = "Cannot find player!";
}
}
if(params[0] == "promote1"){
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "You promoted "@params[1]@" to: Warrior.";
pl.chat = "You have been promoted to: Warrior";
sleep(1);
pl.clientr.position = "Warrior";
} else {
player.chat = "Player not found!";
}
}
if(params[0] == "promote2"){
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "You promoted "@params[1]@" to: Gladiator.";
pl.chat = "You have been promoted to: Gladiator";
sleep(1);
pl.clientr.position = "Gladiator";
} else {
player.chat = "Player not found!";
}
}
if(params[0] == "promote3"){
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "You promoted "@params[1]@" to: Marshall.";
pl.chat = "You have been promoted to: Marshall";
sleep(1);
pl.clientr.position = "Marshall";
} else {
player.chat = "Player not found!";
}
}
if(params[0] == "promote4"){
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "You promoted "@params[1]@" to: War Mongrel.";
pl.chat = "You have been promoted to: War Mongrel";
sleep(1);
pl.clientr.position = "War Mongrel";
} else {
player.chat = "Player not found!";
}
}
if(params[0] == "promote5"){
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "You promoted "@params[1]@" to: Ancient Warrior.";
pl.chat = "You have been promoted to: Ancient Warrior";
sleep(1);
pl.clientr.position = "Ancient Warrior";
} else {
player.chat = "Player not found!";
}
}
if(params[0] == "promote6"){
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "You promoted "@params[1]@" to: Legendary Warrior.";
pl.chat = "You have been promoted to: Legendary Warrior";
sleep(1);
pl.clientr.position = "Legendary Warrior";
} else {
player.chat = "Player not found!";
}
}
if(params[0] == "promote7"){
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "You promoted "@params[1]@" to: Fabled Warrior.";
pl.chat = "You have been promoted to: Fabled Warrior";
sleep(1);
pl.clientr.position = "Fabled Warrior";
} else {
player.chat = "Player not found!";
}
}
if(params[0] == "demote"){
this.clan = clientr.clan;
temp.pl = findplayerbycommunityname(params[1]);
if (pl != NULL){
player.chat = "Demoted: "@params[1];
pl.chat = "You have been demoted down to Recruit.";
pl.clientr.position ="Recruit";
} else{
player.chat = "Cannot find player!";
}
}
}
//#CLIENTSIDE
function onPlayerChats(){
if (player.chat.starts("/addmember")){
triggerserver("gui",this.name,"add",player.chat.substring(11));
}
if (player.chat.starts("/promote")){
temp.pl = findplayerbycommunityname(player.chat.substring(9));
if (pl != NULL){
if (pl.clientr.position =="Recruit"){
triggerserver("gui",this.name,"promote1",player.chat.substring(9));
}
if (pl.clientr.position =="Warrior"){
triggerserver("gui",this.name,"promote2",player.chat.substring(9));
}
if (pl.clientr.position =="Gladiator"){
triggerserver("gui",this.name,"promote3",player.chat.substring(9));
}
if (pl.clientr.position =="Marshall"){
triggerserver("gui",this.name,"promote4",player.chat.substring(9));
}
if (pl.clientr.position =="War Mongrel"){
triggerserver("gui",this.name,"promote5",player.chat.substring(9));
}
if (pl.clientr.position =="Ancient Warrior"){
triggerserver("gui",this.name,"promote6",player.chat.substring(9));
}
if (pl.clientr.position =="Legendary Warrior"){
triggerserver("gui",this.name,"promote7",player.chat.substring(9));
}
if (pl.clientr.position =="Fabled Warrior"){
player.chat = "Cannot promote "@pl@" any higher!";
}
}else{
player.chat = "Cannot find player!";
}
}
if (player.chat.starts("/demote")){
triggerserver("gui",this.name,"demote",player.chat.substring(8));
}
}