10.10.2010, 17:27
(
Последний раз редактировалось Mike_Peterson; 11.10.2010 в 10:56.
Причина: Fixed
)
Me, my friend and another scripter are making a roleplay server from scratch and I'm making the auto login system.. but i get something wierd...
I tried to go under my friend's name and i get auto logged in.. and i made that theres a check fi the players ip is same as in his userfile the player logs in automatically.. and my ip isnt same as him..
Please help me A.S.A.P.
I tried to go under my friend's name and i get auto logged in.. and i made that theres a check fi the players ip is same as in his userfile the player logs in automatically.. and my ip isnt same as him..
Код:
public OnPlayerConnect(playerid) { new name[MAX_PLAYER_NAME]; new ip[50]; new tmp2[256]; tmp2 = dini_Get(file,"IP-Adress"); GetPlayerName(playerid, name, sizeof(name)); format(file,sizeof(file),"SF-RP/%s.ini",name); new namestring = strfind(name, "_", true); if(namestring == -1) { SendClientMessage(playerid, COLOR_BRIGHTRED, "[System] This server only allows Firstname_Lastname"); Kick(playerid); return 1; } if(!fexist(file)) { IsRegistered[playerid] = 0; SCM(playerid,COLOR_YELLOW,"[System]You have not registered, please /register"); SetSpawnInfo(playerid,0,26,-1969.3481,117.7218,27.6875,359,0,0,0,0,0,0); return 1; } if(dini_Exists(file)) { GetPlayerIp(playerid,ip,50); if( (!strcmp(ip,tmp2))) SetSpawnInfo(playerid,0,PlayerInfo[playerid][Skin],PlayerInfo[playerid][playerX],PlayerInfo[playerid][playerY],PlayerInfo[playerid][playerZ],0,0,0,0,0,0,0); SCM(playerid,COLOR_GREEN,"[System]You have been automatically logged in, Welcome back!"); IsLogged[playerid] = 1; SpawnPlayer(playerid); return 1; } else if((!strcmp(ip,!tmp2)) && (dini_Exists(file))) { SCM(playerid,COLOR_YELLOW,"[System] You have to login to your account, please /login"); IsLogged[playerid] = 0; return 0; } return 1; }