05.04.2011, 02:11
Код:
dcmd_login(playerid,params[]){ new file[256],n[MAX_PLAYER_NAME]; GetPlayerName(playerid,n,MAX_PLAYER_NAME); format(file,sizeof(file),"MAdmin/Users/%s.ini",n); if(!dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are not registered! Please /register"); if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already logged in!"); if(PInfo[playerid][Regged] == 0) return SendClientMessage(playerid,ORANGE,"You are not registered! Please /register"); if(strlen(params)) { new pass[256]; pass = dini_Get(file,"Password"); if(dini_Exists(file)) { if(strcmp(params,pass,false) != 0) { SendClientMessage(playerid,YELLOW,"Wrong Password!"); } else { dini_Int(file,"Logged",1); PInfo[playerid][Logged] = 1; PInfo[playerid][Level] = dini_Int(file,"Level"); SendClientMessage(playerid,YELLOW,"You have now logged in!"); return 1; } } } else { SendClientMessage(playerid,GREY,"USAGE: /login <Password>"); return 1; } return 1;}