Quote:
Originally Posted by BroZeus
well there is a way of doint it
so here is it how it is done
Use unix time stamps you can read them about them here https://sampforum.blast.hk/showthread.php?tid=254915
so here is an example of how to do it
pawn Код:
public OnPlayerDisconnect(playerid) { new last = gettime(); new IP[16+1]; GetPlayerIp(playerid, IP, sizeof(IP));
//now save the these both in file // //we will be loading them on player connect return 1; }
public OnPlayerConnect { //load the varaibes which we saved suppose you loaded them in Player[playerid[LastLoggedIn] and Player[playerid][IP] new nip[17]; GetPlayerIp(playerid, nip, 17);
if(!strcmp(Player[playerid][IP], nip, true) && Player[playerid][LastLoggedIn] <= (60*120)/*2 hours*/) { //auto login procedure here return 1; } //login procedure return 1; }
|
As far as I'm concerned, this has a massive security hole since you can login to any account by using this method. It basically just checks if your IP has been logged in sometime the last 2 hours..
Also, you cannot use GetPlayerIp in OnPlayerDisconnect.