Jump to content
  • 0

Problema Login System


n1cabbs

Question

Nick: n1cabbs

Problema: Cand ma conectez pe server , orice parola as baga tot ma conecteaza , nu se intampla tuturor jucatorilor , doar unora.

Erori / warnings: la compilare nu am nimic.

Lini/script:

OnPlayerRegister:

PUBLIC: OnPlayerLogin(playerid,password[])
{
	new tmp2[256];
    new string2[64];
    new string[128];
    new playersip[24];
	new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    GetPlayerIp(playerid, playersip, sizeof(playersip));
	format(string2, sizeof(string2), "users/%s.ini", playername2);
	new File: UserFile = fopen(string2, io_read);
	if ( UserFile )
	{
	    new PassData[256];
	    new keytmp[256], valtmp[256];
	    fread( UserFile , PassData , sizeof( PassData ) );
	    keytmp = ini_GetKey( PassData );
	    if( strcmp( keytmp , "Key" , true ) == 0 )
		{
			valtmp = ini_GetValue( PassData );
			strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
		}
		if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
		{
			    new key[ 256 ] , val[ 256 ];
			    new Data[ 256 ];
			    while ( fread( UserFile , Data , sizeof( Data ) ) )
				{
					key = ini_GetKey( Data );
					if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
			    	if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
			    	if( strcmp( key , "HelperLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHelper] = strval( val ); }
			        if( strcmp( key , "DonateRank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDonateRank] = strval( val ); }
			        if( strcmp( key , "UpgradePoints" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][gPupgrade] = strval( val ); }
			        if( strcmp( key , "ConnectedTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pConnectTime] = strval( val ); }
			        if( strcmp( key , "Registered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pReg] = strval( val ); }
			        if( strcmp( key , "Sex" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSex] = strval( val ); }
			        if( strcmp( key , "Age" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAge] = strval( val ); }
			        if( strcmp( key , "Origin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pOrigin] = strval( val ); }
			        if( strcmp( key , "CK" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCK] = strval( val ); }
			        if( strcmp( key , "Muted" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMuted] = strval( val ); }
			        if( strcmp( key , "Respect" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExp] = strval( val ); }
                   if( strcmp( key , "Crashed" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCrashed] = strval( val ); }

					if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
			        if( strcmp( key , "Bank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAccount] = strval( val ); }
			        if( strcmp( key , "Crimes" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCrimes] = strval( val ); }
			        if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
			        if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
			        if( strcmp( key , "Arrested" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pArrested] = strval( val ); }
			        if( strcmp( key , "WantedDeaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWantedDeaths] = strval( val ); }
			        if( strcmp( key , "Phonebook" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPhoneBook] = strval( val ); }
			        if( strcmp( key , "LottoNr" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLottoNr] = strval( val ); }
			        if( strcmp( key , "Fishes" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFishes] = strval( val ); }
			        if( strcmp( key , "BiggestFish" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBiggestFish] = strval( val ); }
			        if( strcmp( key , "Job" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJob] = strval( val ); }
			        if( strcmp( key , "Paycheck" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayCheck] = strval( val ); }
			        if( strcmp( key , "HeadValue" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHeadValue] = strval( val ); }
			        if( strcmp( key , "Jailed" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJailed] = strval( val ); }
			        if( strcmp( key , "JailTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJailTime] = strval( val ); }
			        if( strcmp( key , "MuteTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMuteTime] = strval( val ); }
			        if( strcmp( key , "Materials" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMats] = strval( val ); }
			        if( strcmp( key , "Drugs" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrugs] = strval( val ); }
			        if( strcmp( key , "SafeMats" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBoxMats] = strval( val ); }
			        if( strcmp( key , "SafeDrugs" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBoxDrugs] = strval( val ); }
			        if( strcmp( key , "DDManager" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDM] = strval( val ); }
                    if( strcmp( key , "DDTicket" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDTK] = strval( val ); }
                    if( strcmp( key , "DDHManager" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDMH] = strval( val ); }
                    if( strcmp( key , "DDHTicket" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDMHTK] = strval( val ); }
					if( strcmp( key , "VirWorld" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pVirWorld] = strval( val ); }
                    if( strcmp( key , "WantedLevel" , true ) == 0 ) { val = ini_GetValue( Data ); WantedLevel[playerid] = strval( val ); }
                    if( strcmp( key , "WantedPoints" , true ) == 0 ) { val = ini_GetValue( Data ); WantedPoints[playerid] = strval( val ); }
					if( strcmp( key , "SpawnLocation" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSpawnLoc] = strval( val ); }
					if( strcmp( key , "WarKills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWarKills] = strval( val ); }
	                if( strcmp( key , "HealKit" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKit] = strval( val ); }
	                if( strcmp( key , "AD" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAD] = strval( val ); }
	                if( strcmp( key , "Wipe" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWipe] = strval( val ); }
	                if( strcmp( key , "AdminSec" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSec] = strval( val ); }
 					if( strcmp( key , "GGManager" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGGDM] = strval( val ); }
					if( strcmp( key , "GGKills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pggKills] = strval( val ); }
					if( strcmp( key , "GGKills2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pggKills2] = strval( val ); }
					if( strcmp( key , "GGDeaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pggDeaths] = strval( val ); }
					if( strcmp( key , "GGLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pggLevel] = strval( val ); }
					if( strcmp( key , "InGG" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pInGG] = strval( val ); }
 					if( strcmp( key , "HRob" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHRob] = strval( val ); }
 					if( strcmp( key , "Rob" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pRob] = strval( val ); }
     				if( strcmp( key , "Towc" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTowc] = strval( val ); }
					if( strcmp( key , "Pastile" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPastile] = strval( val ); }
			        if( strcmp( key , "Pills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPills] = strval( val ); }
                	if( strcmp( key , "MinigunKills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pminigunKills] = strval( val ); }
					if( strcmp( key , "MinigunKills2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pminigunKills2] = strval( val ); }
					if( strcmp( key , "MinigunDeaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pminigunDeaths] = strval( val ); }
					if( strcmp( key , "InMinigun" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pInMinigun] = strval( val ); }
					if( strcmp( key , "Slot2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDGun2] = strval( val ); } //dgun
                    if( strcmp( key , "Slot3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDGun3] = strval( val ); } //dgun
                    if( strcmp( key , "Slot4" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDGun4] = strval( val ); } //dgun
					if( strcmp( key , "Slot5" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDGun5] = strval( val ); } //dgun
 					if( strcmp( key , "CarBan" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarBan] = strval( val ); }
                    if( strcmp( key , "TicketCasino" , true ) == 0 ) { val = ini_GetValue( Data ); TicketCasino[playerid] = strval( val ); }
			        if( strcmp( key , "Leader" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLeader] = strval( val ); }
			        if( strcmp( key , "Member" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMember] = strval( val ); }
			        if( strcmp( key , "FMember" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFMember] = strval( val ); }
			        if( strcmp( key , "Rank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pRank] = strval( val ); }
     				if( strcmp( key , "ClubWarns" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pClubWarns] = strval( val ); }
					if( strcmp( key , "ClubRank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pClubRank] = strval( val ); }
					if( strcmp( key , "ClubMember" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pClubMember] = strval( val ); }
					if( strcmp( key , "ClubLeader" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pClubLeader] = strval( val ); }
					if( strcmp( key , "Bounty" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBounty] = strval( val ); }
			        if( strcmp( key , "Char" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pChar] = strval( val ); }
		        	if( strcmp( key , "NFS" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pNFS] = strval( val ); }
			        if( strcmp( key , "CompMission" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCompMission] = strval( val ); }
					if( strcmp( key , "ContractTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pContractTime] = strval( val ); }
			        if( strcmp( key , "DetSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDetSkill] = strval( val ); }
			        if( strcmp( key , "SexSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSexSkill] = strval( val ); }
			        if( strcmp( key , "BoxSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBoxSkill] = strval( val ); }
			        if( strcmp( key , "LawSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLawSkill] = strval( val ); }
			        if( strcmp( key , "MechSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMechSkill] = strval( val ); }
			        if( strcmp( key , "JackSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pJackSkill] = strval( val ); }
			        if( strcmp( key , "CarSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarSkill] = strval( val ); }
			        if( strcmp( key , "NewsSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pNewsSkill] = strval( val ); }
			        if( strcmp( key , "DrugsSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrugsSkill] = strval( val ); }
			        if( strcmp( key , "CookSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCookSkill] = strval( val ); }
			        if( strcmp( key , "FishSkill" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFishSkill] = strval( val ); }
			        if( strcmp( key , "pSHealth" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSHealth] = floatstr( val ); }
			        if( strcmp( key , "pHealth" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHealth] = floatstr( val ); }
			        if( strcmp( key , "Int" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pInt] = strval( val ); }
			        if( strcmp( key , "Local" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLocal] = strval( val ); }
			        if( strcmp( key , "Team" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeam] = strval( val ); }
			        if( strcmp( key , "Model" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pModel] = strval( val ); }
			        if( strcmp( key , "PhoneNr" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPnumber] = strval( val ); }
			        if( strcmp( key , "House" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPhousekey] = strval( val ); }
			        if( strcmp( key , "Bizz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPbiskey] = strval( val ); }
			        if( strcmp( key , "Pos_x" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPos_x] = floatstr( val ); }
			        if( strcmp( key , "Pos_y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPos_y] = floatstr( val ); }
           			if( strcmp( key , "Pos_z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPos_z] = floatstr( val ); }
           			if( strcmp( key , "CarLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarLic] = strval( val ); }
                    if( strcmp( key , "FlyLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFlyLic] = strval( val ); }
					if( strcmp( key , "BoatLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBoatLic] = strval( val ); }
			        if( strcmp( key , "FishLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFishLic] = strval( val ); }
			        if( strcmp( key , "GunLic" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGunLic] = strval( val ); }
			        if( strcmp( key , "Gun1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun1] = strval( val ); }
			        if( strcmp( key , "Gun2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun2] = strval( val ); }
			        if( strcmp( key , "Gun3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun3] = strval( val ); }
			        if( strcmp( key , "Gun4" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pGun4] = strval( val ); }
			        if( strcmp( key , "Ammo1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo1] = strval( val ); }
			        if( strcmp( key , "Ammo2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo2] = strval( val ); }
			        if( strcmp( key , "Ammo3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo3] = strval( val ); }
			        if( strcmp( key , "Ammo4" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAmmo4] = strval( val ); }
			        if( strcmp( key , "CarTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCarTime] = strval( val ); }
			        if( strcmp( key , "PayDay" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDay] = strval( val ); }
			        if( strcmp( key , "PayDayHad" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDayHad] = strval( val ); }
			        if( strcmp( key , "CDPlayer" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCDPlayer] = strval( val ); }
			        if( strcmp( key , "Wins" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWins] = strval( val ); }
			        if( strcmp( key , "Loses" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLoses] = strval( val ); }
			        if( strcmp( key , "AlcoholPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAlcoholPerk] = strval( val ); }
			        if( strcmp( key , "DrugPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDrugPerk] = strval( val ); }
			        if( strcmp( key , "MiserPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMiserPerk] = strval( val ); }
			        if( strcmp( key , "PainPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPainPerk] = strval( val ); }
			        if( strcmp( key , "TraderPerk" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTraderPerk] = strval( val ); }
			        if( strcmp( key , "Tutorial" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTut] = strval( val ); }
			        if( strcmp( key , "Mission" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMissionNr] = strval( val ); }
			        if( strcmp( key , "Warnings" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWarns] = strval( val ); }
			        if( strcmp( key , "FacWarns" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFACWarns] = strval( val ); }
 					if( strcmp( key , "Acces Warns" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAWarns] = strval( val ); }
			        if( strcmp( key , "LeaderWarns" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLeaderWarns] = strval( val ); }
			        if( strcmp( key , "Adjustable" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdjustable] = strval( val ); }
			        if( strcmp( key , "Fuel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFuel] = strval( val ); }
			      
			        if( strcmp( key , "Married" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMarried] = strval( val ); }
			        if( strcmp( key , "MarriedTo" , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayerInfo[playerid][pMarriedTo], val, 0, strlen(val)-1, 255); }
					if( strcmp( key , "Locked" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLocked] = strval( val ); }
                }
                fclose(UserFile);
		}
		else
		{
			new loginstring[128];
			new loginname[64];
			gPlayerLogTries[playerid] += 1;
			GetPlayerName(playerid,loginname,sizeof(loginname));
			format(loginstring,sizeof(loginstring),"{EBDB14}Parola Gresita\n{FFFFFF}Te rugam sa introduci parola corecta\n{FFFFFF}Ai introdus gresit {FA0021}%d{FFFFFF}/4 {FA0021}Ban!",gPlayerLogTries[playerid],loginname);
			ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"{0080FF}Login",loginstring,"Login","Exit");
	        fclose(UserFile);
        	format(loginstring, 256, "{FF6600}LOGIN: {DB0000}%s (%s) {FF6600}a gresit parola la logare", loginname, playersip);
			ABroadCast(COLOR_YELLOW2,loginstring,1);
			if(gPlayerLogTries[playerid] >= 1) { format(string, sizeof(string), "{F81414}ATENTIE:{FFFF00} Daca gresesti parola de 4 ori consecutiv primesti ban. Ai gresit de %d/{F81414}4{FFFF00} ori.",gPlayerLogTries[playerid]); SendClientMessage(playerid, COLOR_WHITE, string); }
	        if(gPlayerLogTries[playerid] == 4) { FixBan2(playerid); }
	        return 1;
		}
		PlayerInfo[playerid][pAdjustable] = 0;
		ResetPlayerMoney(playerid);
		ConsumingMoney[playerid] = 1;
		GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
		CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
		if(PlayerInfo[playerid][pReg] == 0)
		{
			PlayerInfo[playerid][pLevel] = 1;
			PlayerInfo[playerid][pCompMission] = 0;
			PlayerInfo[playerid][pSHealth] = 0.0;
			PlayerInfo[playerid][pHealth] = 50.0;
			PlayerInfo[playerid][pPos_x] = 2246.6;
			PlayerInfo[playerid][pPos_y] = -1161.9;
			PlayerInfo[playerid][pPos_z] = 1029.7;
			PlayerInfo[playerid][pInt] = 15;
			PlayerInfo[playerid][pLocal] = 255;
			PlayerInfo[playerid][pTeam] = 3;
			PlayerInfo[playerid][pModel] = 299;
			new randphone = 1000 + random(8999);
			PlayerInfo[playerid][pPnumber] = randphone;
			PlayerInfo[playerid][pPhousekey] = 255;
			PlayerInfo[playerid][pPbiskey] = 255;
			PlayerInfo[playerid][pAccount] = 50000;
			PlayerInfo[playerid][pReg] = 1;
			PlayerInfo[playerid][pWipe] = 1;
			PlayerInfo[playerid][pExp] = 0;
			GivePlayerMoney(playerid, 100000);
				GivePlayerMoney(playerid, -10000);
				GivePlayerMoney(playerid, 500);
		}
		if(PlayerInfo[playerid][pLocked] == 1) // Auto-kick
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "{FFFFFF}Contul este blocat.");
      		FixKick3(playerid);
		}
		if(PlayerInfo[playerid][pLevel] == -999) //autoban
		{
			FixBan(playerid);
		}
		else if(PlayerInfo[playerid][pCK] > 0)
		{
      		FixKick3(playerid);
		}
		TextDrawHideForPlayer(playerid,lbt);
		TextDrawHideForPlayer(playerid,lbb);
		SendClientMessage(playerid, COLOR_GREEN, "{CC3300}=============================================");
		format(string2, sizeof(string2), "{ffffff}SERVER: Bine ai venit {FFFF80}%s",playername2);
		SendClientMessage(playerid, COLOR_WHITE,string2);
		printf("%s has logged in.",playername2);
		if (PlayerInfo[playerid][pDonateRank] > 0)
		{
			SendClientMessage(playerid, COLOR_WHITE,"{ffffff}SERVER: Teai connectat ca{FFFF80}VIP user.");
		}
		if (PlayerInfo[playerid][pAdmin] > 0)
		{
			format(string2, sizeof(string2), "{ffffff}SERVER: Teai connectat ca admin level {FFFF80}%d ",PlayerInfo[playerid][pAdmin]);
			SendClientMessage(playerid, COLOR_WHITE,string2);
		}
		if (PlayerInfo[playerid][pHelper] > 0)
		{
			format(string2, sizeof(string2), "{ffffff}SERVER: Teai connectat ca {FFFF80}Helper.",PlayerInfo[playerid][pHelper]);
			SendClientMessage(playerid, COLOR_WHITE,string2);
		}
		if (PlayerInfo[playerid][pLevel] >= 0)
		{
			format(string2, sizeof(string2), "{ffffff}[LOGIN]: %s a intrat cu IP: {FFFF80}%s.",playername2, playersip);
			SendAdminMessage(COLOR_YELLOW2,string2);
		}
		SendClientMessage(playerid, COLOR_GREEN, "{CC3300}=============================================");
		if(gTeam[playerid] == 0)
		{
			gTeam[playerid] = 3;
		}
		else
		{
			gTeam[playerid] = PlayerInfo[playerid][pTeam];
                 }
OnPlayerLogin
	OnPlayerLogin(playerid,tmppass);
			}
			else
			{
				new loginstring[128];
				new loginname[64];
				gPlayerLogTries[playerid] += 1;
				GetPlayerName(playerid,loginname,sizeof(loginname));
				format(loginstring,sizeof(loginstring),"{EBDB14}Parola Gresita\n{FFFFFF}Te rugam sa introduci parola corecta\n{FFFFFF}Ai introdus gresit {FA0021}%d{FFFFFF}/4 {FA0021}Ban!",gPlayerLogTries[playerid],loginname);
				ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"{0080FF}Login",loginstring,"Login","Exit");
				if(gPlayerLogTries[playerid] == 4)
				{
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Ati primit ban motiv: parola gresita de 4 ori!");
				FixBan(playerid);
				}
			}
		}
		if(dialogid == 12345)
		{
		    if(strlen(inputtext))
		    {
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "users/%s.ini", sendername);
				new File: hFile = fopen(string, io_read);
				if (hFile)
				{
					SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
					fclose(hFile);
					return 1;
				}
				new tmppass[64];
				strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
				Encrypt(tmppass);
				OnPlayerRegister(playerid,tmppass);
			}
			else
			{
 				new regstring[128];
				new regname[64];
				GetPlayerName(playerid,regname,sizeof(regname));
				format(regstring,sizeof(regstring),"{FFFFFF}Bine ai venit, {F81414}%s \n \n{FFFFFF}Nu aveti un cont.\n \nVa rugam sa va inregistrati contul prin tastarea parolei in casuta de mai jos:",regname);
				ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"{80FB04}Register",regstring,"Register","Exit");
			}
		}
		if(dialogid == 50)
        {
	       if(response)
	       {
	         if(listitem == 0)
	         {
	             PlayerInfo[playerid][pSex] = 1;
				 SendClientMessage(playerid,COLOR_YELLOW,"{FF0000}[REGISTER] {55D4FF}Ok, Deci esti {ffffff}barbat");
				 ShowPlayerDialog(playerid,51,DIALOG_STYLE_LIST,"{F81414}Alege unde vrei sa fi spawnat","Los Santos \nSan Fierro \nLas Venturas","Select","");
			 }
			 else if(listitem == 1)
			 {
			     PlayerInfo[playerid][pSex] = 2;
			     SendClientMessage(playerid,COLOR_YELLOW,"{FF0000}[REGISTER] {55D4FF}Ok, Deci esti {ffffff}femeie");
			     ShowPlayerDialog(playerid,51,DIALOG_STYLE_LIST,"{F81414}Alege unde vrei sa fi spawnat","Los Santos \nSan Fierro \nLas Venturas","Select","");
			 }
		   }
	    }

	    if(dialogid == 51)
	    {
	       if(response)
	       {
	          if(listitem == 0)
	          {
                  PlayerInfo[playerid][pOrigin] = 2;//LS
				  SendClientMessage(playerid,COLOR_YELLOW,"{FF0000}[REGISTER] {55D4FF}Ok, vei locui in {ffffff}Los Santos");
				  ShowPlayerDialog(playerid,53,DIALOG_STYLE_INPUT,"{F81414}Varsta","Scrie ce varsta ai!","OK","");
                ShowPlayerDialog(playerid,52,DIALOG_STYLE_INPUT,"{F81414}E-mail","{ffffff}Scrie e-mail tau!","OK","");
			  }
			  else if(listitem == 1)
			  {
                  PlayerInfo[playerid][pOrigin] = 1;//SF
			      SendClientMessage(playerid,COLOR_YELLOW,"{FF0000}[REGISTER] {55D4FF}Ok, vei locui in {ffffff}San Fierro");
			      ShowPlayerDialog(playerid,53,DIALOG_STYLE_INPUT,"{F81414}Varsta","Scrie ce varsta ai!","OK","");
			     ShowPlayerDialog(playerid,52,DIALOG_STYLE_INPUT,"{F81414}E-mail","{ffffff}Scrie e-mail tau!","OK","");
			  }
			  else if(listitem == 2)
			  {
                  PlayerInfo[playerid][pOrigin] = 3;//LV
			      SendClientMessage(playerid,COLOR_YELLOW,"{FF0000}[REGISTER] {55D4FF}Ok, vei locui in {ffffff}Las Venturas");
			      ShowPlayerDialog(playerid,53,DIALOG_STYLE_INPUT,"{F81414}Varsta","Scrie ce varsta ai!","OK","");
			      ShowPlayerDialog(playerid,52,DIALOG_STYLE_INPUT,"{F81414}E-mail","{ffffff}Scrie e-mail tau!","OK","");
			  }
		   }
	    }
	   if(dialogid == 52)
	    {
	       if(response)
	       {
                  OnPlayerUpdateEx(playerid);
				  SendClientMessage(playerid,COLOR_YELLOW,"{FF0000}[REGISTER] {F81414}OK,multumim pentru confirmarea {ffffff}e-mail {F81414}dvs.");
				  ShowPlayerDialog(playerid,53,DIALOG_STYLE_INPUT,"{F81414}Varsta","{ffffff}Scrie ce varsta ai!","OK","");
		   }
	    }
	    if(dialogid == 53)
	    {
	       if(response)
	       {
	          new varsta = strval(inputtext);
	          if(varsta >1 && varsta<100)
	          {
		         format(string,256,"{FF0000}[REGISTER] {55D4FF}Deci ai{ffffff} %d {55D4FF}ani",varsta);
		         SendClientMessage(playerid,COLOR_GRAD1,string);
		         PlayerInfo[playerid][pAge] = varsta;
		         RegistrationStep[playerid] = 0;
		         TutTime[playerid] = 1;
				 OnPlayerUpdateEx(playerid);
			  }
			  else return ShowPlayerDialog(playerid,52,DIALOG_STYLE_INPUT,"{F81414}Varsta","Scrie ce varsta ai!","OK","");
		   }
	    }

	}
	return 1;
}
PUBLIC: Speed(playerid)
{
	for(new p = 0; p < GetMaxPlayers(); p++) if(IsPlayerConnected(p) && !IsPlayerNPC(p))
	{
		new vehicleid = GetPlayerVehicleID(p);
		if(vehicleid)
		{

	        new string[512], Float:X, Float:Y, Float:Z, Float:PointToPoint, Float:vhealth;
         	GetVehicleVelocity(vehicleid, X, Y, Z);
         	PointToPoint = (floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)))*100;
			GetVehicleHealth(vehicleid,vhealth);
			format(string,sizeof string ,"{AE1F1F}Masina: {3BBA4E}%s\n{AE1F1F}Rezistenta: {3BBA4E}%.2f\n{AE1F1F}Viteza: {3BBA4E}%i km/h\n{AE1F1F}Benzina: {3BBA4E}%i % ", VehicleName[GetVehicleModel(vehicleid)-400], vhealth, floatround(PointToPoint, floatround_floor), Gas[vehicleid]);
			DeletePlayer3DTextLabel(p, speedo3Dtext);
	    	speedo3Dtext = CreatePlayer3DTextLabel(p, string, speedcolor, 0.0,-1.6,-0.35,20.0, INVALID_PLAYER_ID, vehicleid);
		} else if(p) { DeletePlayer3DTextLabel(p, speedo3Dtext); }
	}
}

Ai incercat sa rezolvi singur ?: Da, dar degeaba.. nu prea ma pricep la scripting.

As fii foarte recunoscator sa ma ajutati.. :)

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Incearca dialogul asta de login :

		if(dialogid == 12346 || dialogid == 12347)
		{
		    if(strlen(inputtext))
		    {
				new tmppass[64];
				strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
				//Encrypt(tmppass);
				OnPlayerLogin(playerid,tmppass);
			}
			else
			{
				new loginstring[128];
				new loginname[64];
				GetPlayerName(playerid,loginname,sizeof(loginname));
				format(loginstring,sizeof(loginstring),"WRONG PASSWORD\nPlease enter the correct password:",loginname);
				ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Exit");
				gPlayerLogTries[playerid] += 1;
				if(gPlayerLogTries[playerid] == 5) { Ban(playerid); }
			}
		}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.