martinatoor 0 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 Zdravim chcel by som sa vás opitať ako by ste riešili tuto situaciu.. kto ziska najviac bodov vyhraca ake kody by ste použili na vyhladavanie kto ma najväčšie score ?? a potom by ho to vpisalo do chatu že mal najviac bodov a vyhral preto sa pitam lebo ja by som to možno aj urobil ale asi s tou najtachšiu cestov tak čakam čady DAKUJEM Link to comment Share on other sites More sharing options...
0 oN3 0 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 Cyklusom (viac http://pawno.cz/cyklus-a-vsetko-o-om-t23608.html) Link to comment Share on other sites More sharing options...
0 Adrián Lipták 51 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 PVary... . Link to comment Share on other sites More sharing options...
0 Jhnzrep 1 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 NO JUST NO! Stiahni si foreach od Y_Less, ovela jednoduchsie a najrychlejsi loop. foreach(Player, i) { // kod } Link to comment Share on other sites More sharing options...
0 martinatoor 0 Odesláno: 10. Červen, 2012 Author Share Odesláno: 10. Červen, 2012 new najvyssie; new string[120]; for(new io = bodik[io];io-- { if(IsPlayerConnected(io)) { najvyssie = bodik[io]; format(string, sizeof(string),"najväčši killer mal: %d KILLS",najvyssie); SendClientMessageToAll(COLOR_RED, string); break; } } a vždy to napiše najväčši killer mal: 1 KILLS aj ked score je uplne ine Link to comment Share on other sites More sharing options...
0 Jhnzrep 1 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 Pretoze io je ID, a mas to break. Tak automaticky povie "najvacsi killer mal: 1 KILLS" Link to comment Share on other sites More sharing options...
0 martinatoor 0 Odesláno: 10. Červen, 2012 Author Share Odesláno: 10. Červen, 2012 Pretoze io je ID, a mas to break. Tak automaticky povie "najvacsi killer mal: 1 KILLS" new najvyssie; new string[120]; for(new io = bodik[io];io-- { if(IsPlayerConnected(io)) { najvyssie = bodik[io]; format(string, sizeof(string),"najväčši killer mal: %d KILLS",najvyssie); SendClientMessageToAll(COLOR_RED, string); break; } } mno ano srry ja som mal preklep ja už ani nerozmyšlam mno stava sa ale ono to aj tak piše raz 1 a raz nula žiaden počet killov tam nieje Link to comment Share on other sites More sharing options...
0 Ad@m 0 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 zmaž break Link to comment Share on other sites More sharing options...
0 martinatoor 0 Odesláno: 10. Červen, 2012 Author Share Odesláno: 10. Červen, 2012 zmaž break zavadza ti ? lebo ja ho nemam dôvod dať preč neboj sa on bude bežať NTP mi može kuriť ***** Link to comment Share on other sites More sharing options...
0 Petr 44 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 zmaž break zavadza ti ? lebo ja ho nemam dôvod dať preč neboj sa on bude bežať NTP mi može kuriť ***** Používáš něco čemu nerozumíš. Oni mají pravdu. Link to comment Share on other sites More sharing options...
0 EEEE 8 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 zmaž break l NTP mi može kuriť ***** Čo tu pletieš NTP ty dementné decko ? Naser nás a uvidíš Link to comment Share on other sites More sharing options...
0 MartinHavo 14 Odesláno: 10. Červen, 2012 Share Odesláno: 10. Červen, 2012 new skore mazplayers. bestplayer for (new i. i < max hracov. i ) { if(skore i > skore bestplayer) bestplayer = i new string 64) format(string.64. Najlepsi hrac s. getplayername(b...bestplayer)) tito patri za cyklus } Link to comment Share on other sites More sharing options...
0 Ad@m 0 Odesláno: 11. Červen, 2012 Share Odesláno: 11. Červen, 2012 zmaž break zavadza ti ? lebo ja ho nemam dôvod dať preč neboj sa on bude bežať NTP mi može kuriť ***** Používáš něco čemu nerozumíš. Oni mají pravdu. ja som mu poradil celý code ktorý upravujete ale ok .. Link to comment Share on other sites More sharing options...
0 MartinHavo 14 Odesláno: 11. Červen, 2012 Share Odesláno: 11. Červen, 2012 Aj tak to je sračka čo ste mu pordaili, bol som na mobile tak t uje celý kód... new kills[MAX_PLAYERS], bestplayer_id; for(new i, i < MAX_PLAYERS, i++) { if(kills[i] > kills[bestplayer_id]) bestplayer_id = i; } new string[64]; format(string,sizeof(sting),"Najlepší hráč v počte zabití je: %s",GetPlayerName(...,bestplayer_id)); SendClientMessageToAll(farba,string); jednoduché a prehľadné Link to comment Share on other sites More sharing options...
0 Ad@m 0 Odesláno: 11. Červen, 2012 Share Odesláno: 11. Červen, 2012 Aj tak to je sračka čo ste mu pordaili, bol som na mobile tak t uje celý kód... new kills[MAX_PLAYERS], bestplayer_id; for(new i, i < MAX_PLAYERS, i++) { if(kills[i] > kills[bestplayer_id]) bestplayer_id = i; } new string[64]; format(string,sizeof(sting),"Najlepší hráč v počte zabití je: %s",GetPlayerName(...,bestplayer_id)); SendClientMessageToAll(farba,string); jednoduché a prehľadné jj len toto treba nahradiť for(new i; i <= MAX_PLAYERS; i++) Link to comment Share on other sites More sharing options...
0 Jhnzrep 1 Odesláno: 11. Červen, 2012 Share Odesláno: 11. Červen, 2012 Y u no use foreach? Najrychlejsi a najednoduchejsi loop. Link to comment Share on other sites More sharing options...
0 Guest Odesláno: 13. Červen, 2012 Share Odesláno: 13. Červen, 2012 Y u no use foreach? Najrychlejsi a najednoduchejsi loop. Loop je pořád stejnej, akorát foreach je optimalizovaný že tam není tolik prázdných míst Link to comment Share on other sites More sharing options...
Dotaz
martinatoor 0
Zdravim chcel by som sa vás opitať ako by ste riešili tuto situaciu..
kto ziska najviac bodov vyhraca
ake kody by ste použili na vyhladavanie kto ma najväčšie score ?? a potom by ho to vpisalo do chatu že mal najviac bodov a vyhral
preto sa pitam lebo ja by som to možno aj urobil ale asi s tou najtachšiu cestov tak čakam čady
DAKUJEM
Link to comment
Share on other sites
16 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now