04.03.2010, 18:10
Place this in the register command
This saves the players IP in the dini
under onplayerconnect
Now i would recommend changing IP at login if case the player got a new PC or moved or any other reason he got a new IP. Use the same as in the register command for this
Код:
new IP[16]; GetPlayerIp(playerid,IP,sizeof(IP)); dini_IntSet(file,"PlayerIP",IP);
under onplayerconnect
Код:
//Make sure it has checked if it has checked if the file exists at this point new IP[16],IP2[16]; GetPlayerIP(playerid,IP,sizeof(ip)); IP2 = dini_Int(file,"PlayerIP"); if(IP == IP2) { //Add the auto login stuff here from before return 1; } else return SendClientMessage(playerid,0xFFFFFF,"You have already registered an account. But IP did not match! Please login"); }