Ok, when I go to test this and select the a certain race it will show that I selected every single race. I was also wondering if someone could tell me how to make it so a player has to be a certain class to select a race. I tried the != but it didnt seem to work...
Code:
public do_chooserace(id,key)
{
if(key == 0) {
if((g_playerclass[id] = class_covenant) && (g_race[id] == race_grunt))
client_print(id,print_chat,"[HaloMod] You're already a Grunt. Select a different race.")
changerace(id)
} else if((g_playerclass[id] == class_covenant) && (g_race[id] == race_grunt)) {
client_print(id,print_chat,"[HaloMod] You are now a Grunt under the Convenants.")
} else if(g_playerclass[id] != class_covenant) {
client_print(id,print_chat,"[HaloMod] You must be a Covenant to select this.")
}
if(key == 1) {
if((g_playerclass[id] = class_covenant) && (g_race[id] == race_jackel))
client_print(id,print_chat,"[HaloMod] You're already a Jackel. Select a different race.")
changerace(id)
} else if((g_playerclass[id] = class_covenant) && (g_race[id] = race_jackel)) {
client_print(id,print_chat,"[HaloMod] You are now a Jackel under the Convenants.")
} else if(g_playerclass[id] != class_covenant) {
client_print(id,print_chat,"[HaloMod] You must be a Covenant to select this.")
return PLUGIN_HANDLED;
}
if(key == 2) {
if((g_playerclass[id] = class_covenant) && (g_race[id] == race_elite))
client_print(id,print_chat,"[HaloMod] You're already an Elite. Select a different race.")
changerace(id)
} else if((g_playerclass[id] = class_covenant) && (g_race[id] = race_elite)) {
client_print(id,print_chat,"[HaloMod] You are now an Elite under the Covenants.")
} else if(g_playerclass[id] != class_covenant) {
client_print(id,print_chat,"[HaloMod] You must be a Covenant to select this.")
return PLUGIN_HANDLED;
}
if(key == 3) {
if((g_playerclass[id] = class_spartan) && (g_race[id] == race_marine))
client_print(id,print_chat,"[HaloMod] You're already a Marine. Select a different race.")
changerace(id)
} else if((g_playerclass[id] = class_spartan) && (g_race[id] = race_marine)) {
client_print(id,print_chat,"[HaloMod] You are now a Marine under the Spartans.")
} else if(g_playerclass[id] != class_spartan) {
client_print(id,print_chat,"[HaloMod] You must be a Spartan to select this.")
return PLUGIN_HANDLED;
}
if(key == 4) {
if((g_playerclass[id] = class_spartan) && (g_race[id] == race_forerunner))
client_print(id,print_chat,"[HaloMod] You're already a Forerunner. Select a different race.")
changerace(id)
} else if((g_playerclass[id] = class_spartan) && (g_race[id] = race_forerunner)) {
client_print(id,print_chat,"[HaloMod] You are now a Forerunner under the Spartans")
} else if(g_playerclass[id] != class_spartan) {
client_print(id,print_chat,"[HaloMod] You must be a Spartan to select this.")
return PLUGIN_HANDLED;
}
ShowHUD(id)
return PLUGIN_HANDLED;
}