23.09.2015, 20:12
pawn Code:
public OnPlayerConnect(playerid)
{
if(fexist(PlayerName(playerid)) //The username is used
{
new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
if(!strcmp(plrIP, pInfo[playerid][PlayerIP]) //The IP matches
{
//IP and username matches. Login player, give money, score, etc..
}
else //IP doesn't match
{
ShowPlayerDialog(//Show login dialog...)
}
}
else //There is no file that has the same name as the player (Player is not registered)
{
//Show register dialog
}
return 1;
}