Jump to content

Recommended Posts

Posted (edited)
new 
     SecundeJucate[MAX_PLAYERS],
     SecundeTimer[MAX_PLAYERS];

forward SecundeJucate(playerid);
public SecundeJucate(playerid) {
  SecundeJucate[playerid] ++;
  return 1;
}

public OnPlayerConenct(playerid) {
  SecundeJucate[playerid] = -1;
  SecundeTimer[playerid] = -1;
  SecundeTimer[playerid] = SetTimerEx("SecundeJucate", true, 1000, "d", playerid);
  return 1;
}

public OnPlayerDisconnect(playerid) {
   KillTimer(SecundeTimer[playerid]);
   return 1;
}

new szString[128], Minute = floatround(SecundeJucate / 60, floatround_round);
format(szString, sizeof(szString), "Ai jucat %i minute", Minute);
SendClientMessage(playerid, -1, szString);

 

Edited by BuNiCu-RP
  • Administrator
Posted

Cel mai eficient mod pe care l-am gasit eu este sa stochezi intr-o variabila (pe jucator) timpul la care jucatorul a intrat pe server sau s-a autentificat si cand se deconecteaza sa ii calculezi diferenta dintre timpul cand s-a deconectat si timpul cand s-a conectat. Poti sa folosesti gettime() pentru a face asta.

Posted

Eu ma refer la timpul in care s-a miscat si timpul in care a stat.

Timpul in care jucatorul a actionat, s-a mutat sau a miscat cursorul sa fie socotit, cel in care player-ul a fost afk sa nu fie socotit.

  • Administrator
Posted

Poti sa ti minte tipul in care nu a facut acele actiuni si sa-l scazi la final.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.