How to check for login count?

Discussion in 'Scripting/Addon Discussion' started by KrisiS, Jan 7, 2016.

  1. KrisiS

    KrisiS Member

    Joined:
    Aug 17, 2013
    Messages:
    89
    Likes Received:
    1
    How can I check the amount of logins from the Database in order to run a script at say for example the 1st login?

    if (total_connections<= 1) then {


    ** Script **

    }



    Many thanks for any help at all!
     
  2. ShootingBlanks

    ShootingBlanks OpenDayZ Guru!

    Joined:
    Mar 31, 2013
    Messages:
    2,422
    Likes Received:
    336
    are we talking about logins for the server as total or for each player?
    if you want the server total, like you join is 1 and i join is 2 then this
    in the player login on line 165 increment a counter.
    logincount =logincount +1;
    if logincount =1,000,000 then award free prize
    make sure to add the counter to your variables.sqf
    logincount = 0;
    https://github.com/DayZMod/DayZ/blob/Development/SQF/dayz_server/compile/server_playerLogin.sqf

    if we are talking about counting how many times a player has connected, like give me a heli when i join the 100th time, i would use profilenamespace and increment each time and check. i think that would be a file exec from init.sqf
    let me know if thats what you want to do and i can whack one out in a moment.
    https://community.bistudio.com/wiki/profileNamespace
     

Share This Page