Posts: 1,018
Threads: 320
Joined: Jul 2010
Hello I made player variable PlayerInfo[playerid][AdminMinute]
and know how can I make how many minut was been on the server some admin if you know what I mean
Posts: 1,018
Threads: 320
Joined: Jul 2010
you give me minutes[playerid] but I have my variable?
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Use gettime() instead of relying on resource intensive timers. I believe there's a tutorial on how to do that.
Posts: 1,018
Threads: 320
Joined: Jul 2010
Quote:
Originally Posted by Konstantinos
No need timers for that! Use GetTickCount instead.
pawn Код:
new CountMilliseconds[ MAX_PLAYERS ] ;
public OnPlayerConnect(playerid) { PlayerInfo[playerid][AdminMinute] = 0; CountMilliseconds[ playerid ] = GetTickCount( ); return 1; }
public OnPlayerDisconnect(playerid, reason) { PlayerInfo[playerid][AdminMinute] = ((GetTickCount( ) - CountMilliseconds[ playerid ]) % (1000*60*60)) / (1000*60); return 1; }
|
is that counting every minute if a player game admin or gamemaster? example i was on the server 4 minutes and I disconnect and in my file is writen 4
Posts: 1,018
Threads: 320
Joined: Jul 2010
Ok just one question how can I make that save only if player admin/gamemaster if you know what I mean or else it's save everyone? Thanks
Posts: 1,018
Threads: 320
Joined: Jul 2010
Quote:
Originally Posted by Tanush123
pawn Код:
if(IsPlayerAdmin(playerid) || Gamemaster) { //save }
|
can I get 100 % working check if player game admin/ game master? Thanks
Posts: 1,018
Threads: 320
Joined: Jul 2010
I mean I want the code that check is player admin or game master example
if(PlayerInfo[playerid][pAdmin] < 0 || PlayerInfo[playerid][pGameMaster]) something like that check if player admin or gamemaster