format(Query,sizeof(Query),\"SELECT * FROM `Users` WHERE `Name` = \'%s\'\",Name(playerid));mysql_query(Query);mysql_store_result();if(mysql_num_rows() != 0){LoginDialog(playerid);}else{ RegisterDialog(playerid);}mysql_free_result();Meg kellene egy automatikusan bejelentkezõ rész, de azt nem akartam kiírni ide, az public(a régebbi)Help pls
Lofasz(...){format(Query,sizeof(Query),\"SELECT * FROM `Users` WHERE `Name` = \'%s\'\", Name(playerid));mysql_function_query(1, Query, true, \"THREAD_CheckAccount\", \"d\", playerid);}forward THREAD_CheckAccount(playerid);public THREAD_CheckAccount(playerid){newrows,fields;cache_get_data(rows, fields);if(rows){LoginDialog(playerid);}else{RegisterDialog(playerid);}return 1;}
// Lekérdezésformat(query, sizeof(query), \"SELECT * FROM `players` WHERE `name` = \'%s\' AND `ip` = \'%s\'\", pName(playerid), ip);mysql_function_query(1, query, true, \"THREAD_Autologin\", \"d\", playerid);forward THREAD_Autologin(playerid);public THREAD_Autologin(playerid){new rows, fields;cache_get_data(rows, fields);if(rows != 0){LoginPlayer(playerid);switch(GetPVarInt(playerid, \"Level\")){ case 0: country = \"~w~Játékos\"; case 1: country = \"~b~Moderátor\"; case 2: country = \"~g~Adminisztrátor\"; case 3: country = \"~y~Fõadmin\"; case 4: country = \"~r~Tulajdonos\";}format(i_str, sizeof(i_str), \"~g~~h~Automatikusan ~h~bejelentkeztél~w~! ~b~~h~~h~(~w~Rang: %s~b~~h~~h~)\", country);InfoTD_MSG(playerid, MESSAGE_TIME, i_str);}return 1;} stock LoginPlayer(playerid){//printf(\"LoginPlayer(playerid = %s(%d)\", pName(playerid), playerid);new Tick1 = GetTickCount();newPVarSet[65],Float:DeathA,_HorseShoes[128],hSh[50],iPhotos[50],_Oysters[128],szPhotos[128],szElements[128],iElement[30],Clothes[64],MyText[64],cVar[8],mVar,iHydType,bool:mUse,mText[45],Float:mOffset,oYs[50],Float:Spin[3],i,iRegID = GetPVarInt(playerid, \"LineID\");if(!iRegID) return print(!\"Login Player error! Wrong line ID!\");PlayerInfo[playerid][pRegID] = iRegID;cache_get_row(0, 2, name); PlayerInfo[playerid][fRegID] = strval(name); // Forum IDcache_get_row(0, 7, name); PVarSet[0] = strval(name); // Levelcache_get_row(0, 8, name); PVarSet[1] = strval(name); // Moneycache_get_row(0, 9, name); PVarSet[2] = strval(name); // Bankcache_get_row(0, 10, name); PVarSet[3] = strval(name); // Killscache_get_row(0, 11, name); PVarSet[4] = strval(name); // Deathscache_get_row(0, 12, name); PVarSet[32] = strval(name); // Killstreakcache_get_row(0, 13, name); PVarSet[5] = strval(name); // Scorecache_get_row(0, 14, name); PVarSet[6] = strval(name); // Fightingstylecache_get_row(0, 15, name); PVarSet[8] = strval(name); // Reactionwinscache_get_row(0, 16, name); PVarSet[30] = strval(name); // Goldpotscache_get_row(0, 17, name); PlayerInfo[playerid][pTotalSeconds] = strval(name); // Online Timecache_get_row(0, 18, name); PVarSet[10] = strval(name); // Postscache_get_row(0, 19, name); PVarSet[11] = strval(name); // HQcache_get_row(0, 20, name); PVarSet[13] = strval(name); // Warnscache_get_row(0, 21, name); PVarSet[28] = strval(name); // Racescache_get_row(0, 22, name); PVarSet[38] = strval(name); // Rablasokcache_get_row(0, 23, name); PVarSet[39] = strval(name); // Rangeshotcache_get_row(0, 24, name); PVarSet[40] = strval(name); // Nitro Statecache_get_row(0, 25, name); PVarSet[42] = strval(name); // Laser Pointercache_get_row(0, 26, name); PVarSet[43] = strval(name); // Last Raboltcache_get_row(0, 27, name); PVarSet[44] = strval(name); // ID Colorcache_get_row(0, 28, name); PVarSet[45] = strval(name); // Flagtimecache_get_row(0, 29, name); PVarSet[46] = strval(name); // BCartimecache_get_row(0, 30, name); PVarSet[47] = strval(name); // Fuvarokcache_get_row(0, 31, name); PVarSet[55] = strval(name); // Stuntbonuscache_get_row(0, 32, name); PVarSet[62] = strval(name); // Fallout Woncache_get_row(0, 33, name); PVarSet[63] = strval(name); // Mute Timecache_get_row(0, 34, name); PVarSet[64] = strval(name); // Freeze Timecache_get_row(0, 35, name); X = floatstr(name); // SavedXcache_get_row(0, 36, name); Y = floatstr(name); // SavedYcache_get_row(0, 37, name); Z = floatstr(name); // SavedZcache_get_row(0, 38, name); PVarSet[14] = strval(name); // Interiorcache_get_row(0, 39, name); PVarSet[15] = strval(name); // Worldcache_get_row(0, 40, name); Angle = floatstr(name); // Worldcache_get_row(0, 41, name); V[0] = floatstr(name); // DeathXcache_get_row(0, 42, name); V[1] = floatstr(name); // DeathYcache_get_row(0, 43, name); V[2] = floatstr(name); // DeathZcache_get_row(0, 44, name); DeathA = floatstr(name); // DeathAcache_get_row(0, 45, name); PVarSet[52] = strval(name); // DeathIntcache_get_row(0, 46, name); PVarSet[53] = strval(name); // DeathWorldcache_get_row(0, 47, name); iHydType = strval(name); // Hydraulics Typecache_get_row(0, 48, name); Spin[0] = floatstr(name); // SpinXcache_get_row(0, 49, name); Spin[1] = floatstr(name); // SpinYcache_get_row(0, 50, name); Spin[2] = floatstr(name); // SpinZcache_get_row(0, 53, name); PVarSet[51] = strval(name); // Chatcolorcache_get_row(0, 54, name); PVarSet[50] = strval(name); // Walkstylecache_get_row(0, 55, name); PVarSet[17] = strval(name); // Jailtimecache_get_row(0, 57, name); PVarSet[19] = strval(name); // Autorepaircache_get_row(0, 60, name); Health = floatstr(name); // Boostcache_get_row(0, 61, name); Armour = floatstr(name); // Hoppingcache_get_row(0, 62, name); PVarSet[34] = strval(name); // Boost Keycache_get_row(0, 63, name); PVarSet[35] = strval(name); // Hopping Keycache_get_row(0, 64, name); PVarSet[36] = strval(name); // Flip Keycache_get_row(0, 67, name); PVarSet[33] = strval(name); // Weathercache_get_row(0, 68, name); PVarSet[23] = strval(name); // Timecache_get_row(0, 69, name); PVarSet[24] = strval(name); // CarColor1cache_get_row(0, 70, name); PVarSet[56] = strval(name); // CarColor2cache_get_row(0, 71, name); PVarSet[57] = strval(name); // Paintjobcache_get_row(0, 72, name); PVarSet[58] = strval(name); // Fav Wheelcache_get_row(0, 73, name); PVarSet[25] = strval(name); // Spawn locationcache_get_row(0, 74, name); PVarSet[26] = strval(name); // Favskincache_get_row(0, 75, name); PVarSet[37] = strval(name); // Armedweaponcache_get_row(0, 76, name); PVarSet[27] = strval(name); // Colorcache_get_row(0, 79, name); g_PlayerFlags[playerid] = e_PlayerFlags:strval(name);// \"clicktele\" -> PlayerFlags// printf(\"Flags: %d, Name: %s\", g_PlayerFlags[playerid], name);/////// Stb kód ide...//}