SA-MP Forums Archive
online time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: online time (/showthread.php?tid=650675)



online time - ivndosos - 04.03.2018

I was surfing around forums, I couldn't really find anything for what I exactly wanted.

I wonder I have this piece of code here (a part of my stats cmd)

Код:
		 format(iString,sizeof(iString),"{ffff99}Online Time:");
		 SendClientMessage(playerid, -1, iString);
	}
 	return 1;
}
I was wondering how do I get the player's online time? (not total)


Re: online time - m4karow - 04.03.2018

maybe

under onplayerconnect
PlayerConnectedTime[playerid] = gettime();

use example (you get the results in seconds)
if((gettime() - PlayerConnectedTime[playerid]) > 3600)
SendClientMessage(playerid, -1, "You connected more than 1 hour!");


Re: online time - ivndosos - 04.03.2018

I figured by my self, thanks tho!