Member
|
06-18-2013
, 14:33
{ Else } Does not get executed when others are false.
|
#1
|
Hey, I am working on a plugin but then I came across error I spent hours trying to fix it. No luck.
Code:
public voteend()
{
g_Voteinuse = 0
new players[32], pnum, tempid;
get_players( players, pnum );
for ( new i; i < pnum; i++ )
{
tempid = players[i];
show_menu( tempid, 0, "^n", 1);
}
if ((g_voteone > g_votetwo) &&
(g_voteone > g_votethree) &&
(g_voteone > g_votefour) &&
(g_voteone > g_votefive) &&
(g_voteone > g_votesix) &&
(g_voteone > g_voteseven)) {
client_print(0, print_chat, "Option 1, %s, has won the vote %s with %d votes.", g_aarg1, g_question, g_voteone);
}else if ((g_votetwo > g_voteseven) &&
(g_votetwo > g_voteone) &&
(g_votetwo > g_votethree) &&
(g_votetwo > g_votefour) &&
(g_votetwo > g_votefive) &&
(g_votetwo > g_votesix)) {
client_print(0, print_chat, "Option 2, %s, has won the vote %s with %d votes.", g_aarg2, g_question, g_votetwo);
}else if ((g_votethree > g_voteone) &&
(g_votethree > g_votetwo) &&
(g_votethree > g_votefour) &&
(g_votethree > g_votefive) &&
(g_votethree > g_votesix) &&
(g_votethree > g_voteseven)) {
client_print(0, print_chat, "Option 3, %s, has won the vote %s with %d votes.", g_aarg3, g_question, g_votethree);
}else if ((g_votefour > g_voteone) &&
(g_votefour > g_votetwo) &&
(g_votefour > g_votethree) &&
(g_votefour > g_votesix) &&
(g_votefour > g_votefive) &&
(g_votefour > g_voteseven)) {
client_print(0, print_chat, "Option 4, %s, has won the vote %s with %d votes.", g_aarg4, g_question, g_votefour);
}else if ((g_votefive > g_voteone) &&
(g_votefive > g_votetwo) &&
(g_votefive > g_votethree) &&
(g_votefive > g_votefour) &&
(g_votefive > g_votesix) &&
(g_votefive > g_voteseven)) {
client_print(0, print_chat, "Option 5, %s, has won the vote %s with %d votes.", g_aarg5, g_question, g_votefive);
}else if ((g_votesix > g_voteone) &&
(g_votesix > g_votetwo) &&
(g_votesix > g_votethree) &&
(g_votesix > g_votefour) &&
(g_votesix > g_votefive) &&
(g_votesix > g_voteseven)) {
client_print(0, print_chat, "Option 6, %s, has won the vote %s with %d votes.", g_aarg6, g_question, g_votesix);
}else if ((g_voteseven > g_voteone) &&
(g_voteseven > g_votetwo) &&
(g_voteseven > g_votethree) &&
(g_voteseven > g_votefour) &&
(g_voteseven > g_votefive) &&
(g_voteseven > g_votesix)) {
client_print(0, print_chat, "Option 7, %s, has won the vote %s with %d votes.", g_aarg7, g_question, g_voteseven);
}else {
client_print(0, print_chat, "%s - Two or more votes won, Displaying all votes:");
client_print(0, print_chat, "Option 1: %s has received %d votes. %s", g_aarg1, g_voteone, g_Arg1);
client_print(0, print_chat, "Option 2: %s has received %d votes. %s", g_aarg2, g_votetwo, g_Arg2);
client_print(0, print_chat, "Option 3: %s has received %d votes. %s", g_aarg3, g_votethree, g_Arg3);
client_print(0, print_chat, "Option 4: %s has received %d votes. %s", g_aarg4, g_votefour, g_Arg4);
client_print(0, print_chat, "Option 5: %s has received %d votes. %s", g_aarg5, g_votefive, g_Arg5);
client_print(0, print_chat, "Option 6: %s has received %d votes. %s", g_aarg6, g_votesix, g_Arg6);
client_print(0, print_chat, "Option 7: %s has received %d votes. %s", g_aarg7, g_voteseven, g_Arg7);
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
When all "else if" are false, the else does not get executed. Nothing just happens. Any help?
|
|