MalvinRO Posted March 21, 2017 Report Share Posted March 21, 2017 Cum e cel mai eficient sa calculez secundele jucate ? cum le calculeaza serverele mari ? Quote Link to comment Share on other sites More sharing options...
BuNiCu-RP Posted March 22, 2017 Report Share Posted March 22, 2017 (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 March 22, 2017 by BuNiCu-RP Quote Link to comment Share on other sites More sharing options...
WopsS Posted March 22, 2017 Report Share Posted March 22, 2017 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. Quote Link to comment Share on other sites More sharing options...
MalvinRO Posted March 22, 2017 Author Report Share Posted March 22, 2017 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. Quote Link to comment Share on other sites More sharing options...
WopsS Posted March 22, 2017 Report Share Posted March 22, 2017 Poti sa ti minte tipul in care nu a facut acele actiuni si sa-l scazi la final. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.