24.09.2009, 22:04
AutoLogin fail
OnPlayerconnect
OnPlayerconnect
Код:
new name[MAX_PLAYER_NAME], str[128],ipa[16]; GetPlayerIp(playerid,ipa,sizeof(ipa)); GetPlayerName(playerid, name, sizeof name); format(str, sizeof str, "%s.ini", name); if(fexist(str)) { new File:account = fopen(str, io_read); new pass[256]; new passres[128], value[128]; fread(account, pass, sizeof pass); passres = GetFileString(pass); if (strfind(passres, "IP") != -1) { value = GetFileValue(pass); Stats[playerid][IP] = strval(value); } fclose(account); } if(!strcmp(ipa,Stats[playerid][IP],true)) { SendClientMessage(playerid,CONNECT1,"You have been automatically logged in."); LoginPlayer(playerid,Stats[playerid][aPassword]); } else { SendClientMessage(playerid,CONNECT1,"You are registered, please /login."); }