Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock CalculateBestScore(turfid, warid)
- {
- new bestname[64], name[64];
- if(WarInfo[turfid][wAttacker] != 0 && WarInfo[turfid][wFaction] != 0)
- {
- new bestscore, group1 = WarInfo[turfid][wAttacker], group2 = WarInfo[turfid][wFaction];
- format(gString, sizeof(gString), "SELECT `name`,`Member,`WarID`,`Ucideri`,`Decese` FROM `users` WHERE `Member` = %d OR `Member` = %d", group1, group2);
- new Cache: result = mysql_query(SQL, gString);
- for(new i, x = cache_get_row_count (); i < x; i++) {
- new score;
- score = cache_get_field_content_int(i, "Ucideri")-cache_get_field_content_int(i, "Decese");
- if(score >= bescscore)
- {
- bestscore = score;
- cache_get_field_content(i, "name", result); format(bestname, 30, name);
- }
- }
- }
- return bestname;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement