25.11.2016, 12:31
So one guy helped me make a code and its have a couple bugs.
First one: When other player online i got hes frags like i had 36 and player online with 0 frags bouth of us get hes frags.
Second: Its count only the last player frags if i kill its doesn't count.
Here the most important code lines. I'm pretty sure its something wrong with this code.
Please help
First one: When other player online i got hes frags like i had 36 and player online with 0 frags bouth of us get hes frags.
Second: Its count only the last player frags if i kill its doesn't count.
Here the most important code lines. I'm pretty sure its something wrong with this code.
Код:
stock UpdateKST() { new string[200]; new KSSlot1 = -1, KSSlot2 = -1, KSSlot3 = -1; new HKSteak=0; for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x)) if (pInfo[x][pKills] >= HKSteak) { HKSteak = pInfo[x][pKills]; KSSlot1 = x; } HKSteak = 0; for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x) && x != KSSlot1) if (pInfo[x][pKills] >= HKSteak) { HKSteak = pInfo[x][pKills]; KSSlot2 = x; } HKSteak = 0; for(new x=0; x<MAX_PLAYERS; x++) if (IsPlayerConnected(x) && x != KSSlot1 && x != KSSlot2) if (pInfo[x][pKills] >= HKSteak) { HKSteak = pInfo[x][pKills]; KSSlot3 = x; } if(KSSlot1 != -1) { format(string, sizeof(string), "______Top_3_KillStreaks~n~~n~1._~g~%s_~w~(KillStreak:_%d)", PlayerName2(KSSlot1), pInfo[KSSlot1][pKills]); } if(KSSlot2 != -1) { format(string, sizeof(string), "______Top_3_KillStreaks~n~~n~1._~g~%s_~w~(KillStreak:_%d)~n~~n~2._~y~%s_~w~(KillStreak:_%d)", PlayerName2(KSSlot1), pInfo[KSSlot2][pKills], PlayerName2(KSSlot2), pInfo[KSSlot2][pKills]); } if(KSSlot3 != -1) { format(string, sizeof(string), "______Top_3_KillStreaks~n~~n~1._~g~%s_~w~(KillStreak:_%d)~n~~n~2._~y~%s_~w~(KillStreak:_%d)~n~~n~3._~y~%s_~w~(KillStreak:_%d)", PlayerName2(KSSlot1), pInfo[KSSlot1][pKills], PlayerName2(KSSlot2), pInfo[KSSlot2][pKills], PlayerName2(KSSlot3), pInfo[KSSlot3][pKills]); } TextDrawSetString(KSTextdraw, string); }