Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: FULL TopPos with overtaking

  1. #11
    Private milepunta's Avatar
    Join Date
    Jan 2014
    Location
    Croatia, Pula
    Posts
    27
    Thanks
    14
    Thanked 26 Times in 11 Posts
    just remove LIMIT if you want all players
    As you once said I'm nothing but a monster!

  2. #12
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    need to find the nearest kills and swap places with him, notifying this(print new pos by player)
    2column:
    pos and kills

  3. #13
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    SELECT MIN(kills)+1 FROM TABLEHERE WHERE player_id != YOUROWNPLAYER_ID AND kills >= YOUROWNKILLS

    SELECT player_id FROM TABLEHERE WHERE player_id != YOUROWNPLAYER_ID AND kills >= YOUROWNOLDKILLS AND kills < YOUROWNNEWKILLS

    these?

    First one to check how much to next pos++, second one to find all players that you passed by doing a kill
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. #14
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    thanks, i will test this.
    I will try, At the moment my sketch:
    PHP Code:
    sql "SELECT COUNT(killszom) FROM Accounts WHERE login != '" self.stats["loginname"] + "' AND killszom >= '" self.lastkillplayers "' AND killszom < '" self.killplayers "'";
    mysql_query(level.mysqlsql);
    result mysql_store_result(level.mysql);
    row mysql_fetch_row(result);
    countstrings int(row[0]);//number of players in the interval killings
    if(countstrings>=1)//continue to execute queries if there are ahead
    {
    sql "SELECT `login` FROM Accounts WHERE `login` != '" self.stats["loginname"] + "' AND killszom >= '" self.lastkillplayers "' AND killszom < '" self.killplayers "'";//this query displays logins players below us in a position, then you can give one to each array, thereby relegating them
    mysql_query(level.mysqlsql);
    result mysql_store_result(level.mysql);
    row mysql_fetch_row(result);
    list=[];
    for(
    i=0;i<countstrings;i++)
    {
    list[
    i]=row[0];
    sql "UPDATE `Accounts` SET toppos=toppos+1 WHERE login='" + list[i] + "'";
    mysql_query(level.mysqlsql);
    }
    sql "SELECT MAX(toppos) FROM Accounts WHERE `login` != '" self.stats["loginname"] + "' AND killszom = '" self.lastkillplayers "'";
    mysql_query(level.mysqlsql);
    result mysql_store_result(level.mysql);
    row mysql_fetch_row(result);
    max=row[0];
    sql "SELECT MIN(toppos) FROM Accounts WHERE `login` != '" self.stats["loginname"] + "' AND killszom = '" self.lastkillplayers "'";
    mysql_query(level.mysqlsql);
    result mysql_store_result(level.mysql);
    row mysql_fetch_row(result);
    min=row[0];
    sql "UPDATE `Accounts` SET toppos=toppos-'"+(max-min+1)+"' WHERE login='" self.stats["loginname"] + "'";
    mysql_query(level.mysqlsql);


  5. #15
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Please dont store ranknumbers in your mysql. Select them when retrieving the data.

    Else your mysql database might become corrupt + it requires a LOT of IO to update all 1k+ players below you whenever you pass someone.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. #16
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    can be more? mysql_free_result(result) after store?

  7. #17
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    I still have no idea what you are trying to accomplish EXACTLY.

    Tell me what you want to do. More details. Better explanations.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  8. #18
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    Metastas!S:
    Click image for larger version. 

Name:	keklan.jpg 
Views:	45 
Size:	750.9 KB 
ID:	1102
    In my mod:
    Menu is working, but when switching players between positions - position(toppos in database) is broken
    Click image for larger version. 

Name:	shot0069.jpg 
Views:	41 
Size:	237.4 KB 
ID:	1104
    Last edited by Paho; 4th May 2016 at 12:22.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •