INI TO SQL HEELP
#1

Hello guys !!
I really need this, im opening dayz server in my country and i started working on gm , and its on ini system , ill put here codes and help to make sql.
PHP код:
    //==========================================================================
    
GetBan(playerid);
    
//==========================================================================
    
new stringisdedamovtyan[256], password2[64];
    
format(stringisdedamovtyansizeof(stringisdedamovtyan), "/aqauntebi/%s.ini"GetName(playerid)); // Задаём путь к файлу
    
new iniFile ini_openFile(stringisdedamovtyan); // Открываем файл.
    
if(iniFile 0ini_openFile(stringisdedamovtyan);
    
ini_getString(iniFile"Password"password2); // Узнаём пароль аккаунта.
    
if(strlen(password2) < strlen(password) || strlen(password2) > strlen(password) || strlen(password) == 0) return ShowPlayerDialog(playerid,dialog_login,DIALOG_STYLE_INPUT,"AVTORIZACIA","Chaweret Tqveni Aqauntis Paroli.","Shesvla","Gasvla");
    if(
strcmp(passwordpassword2false)) return ShowPlayerDialog(playerid,dialog_login,DIALOG_STYLE_INPUT,"AVTORIZACIA","Chaweret Tqveni Aqauntis Paroli.","Shesvla","Gasvla");
    
// если пароль верный то:
    
Login[playerid] = 1;
    
ini_getInteger(iniFile"Kills"Player[playerid][pKillsZ]);
    
ini_getInteger(iniFile"HShots"Player[playerid][pHShots]); // Запишем кол-во kills в переменную.
    
ini_getInteger(iniFile"Sex"Player[playerid][pSex]);
    
ini_getFloat(iniFile"Blood"Player[playerid][pBlood]); // Запишем кол-во жизней в переменную.
    
ini_getFloat(iniFile"Armor"Player[playerid][pArmor]);
    
ini_getFloat(iniFile"Temperature"Player[playerid][pTemp]);
    
ini_getInteger(iniFile"Thirst"Player[playerid][pThirst]);
    
ini_getInteger(iniFile"Level"Player[playerid][pLevel]);
    
ini_getInteger(iniFile"Gangid"Player[playerid][pGangid]);
    
ini_getInteger(iniFile"Leader"Player[playerid][pLeader]);
    
ini_getInteger(iniFile"Rank"Player[playerid][pRank]);
    
ini_getInteger(iniFile"VIP"Player[playerid][pVIP]);
    
ini_getInteger(iniFile"Coin"Player[playerid][pCoin]);
    
ini_getInteger(iniFile"CTime"Player[playerid][pCTime]);
    
ini_getInteger(iniFile"Hunger"Player[playerid][pHunger]);
    
ini_getInteger(iniFile"Pack"Player[playerid][pPack]);
    
ini_getFloat(iniFile"PosX"Player[playerid][PosX]);
    
ini_getFloat(iniFile"PosY"Player[playerid][PosY]); //при авторизации узнаем координату Y
    
ini_getFloat(iniFile"PosZ"Player[playerid][PosZ]); //при авторизации узнаем координату Z
    
ini_getInteger(iniFile"Admin"Player[playerid][pAdmin]);
    
ini_getInteger(iniFile"Karma"Player[playerid][pKarma]); //
    
ini_getInteger(iniFile"STD"Player[playerid][pSTD]); //
    
ini_getInteger(iniFile"ConnectTime"Player[playerid][pConnectTime]); // Запишем кол-во убийств в файл.
    
ini_getInteger(iniFile"Death"Player[playerid][pDeath]);
    
ini_getInteger(iniFile"KillsS"Player[playerid][pKillsS]);
    
ini_getInteger(iniFile"Kill_game"Player[playerid][pKill_game]);
    
ini_getInteger(iniFile"Loot"Player[playerid][pLoot]);
    
ini_getInteger(iniFile"Noga"Player[playerid][pNoga]);
    
ini_getInteger(iniFile"Kill_s_g"Player[playerid][pKill_s_g]);
    
ini_getInteger(iniFile"Sec"Player[playerid][pSec]);
    
ini_getInteger(iniFile"Min"Player[playerid][pMin]);
    
ini_getInteger(iniFile"Hour"Player[playerid][pHour]);
    
ini_getInteger(iniFile"Skin"Player[playerid][pSkin]);
    
ini_getInteger(iniFile"Message"Player[playerid][pMessage]);
    
ini_getInteger(iniFile"Slots"Player[playerid][pSlots]);
    
ini_getInteger(iniFile"Bad"Player[playerid][pBad]);
    
ini_getFloat(iniFile"FA"Player[playerid][pFA]); 
    for(new 
i=0;i<INVNUMBERS;i++)
    {
        new 
idstr[256];
        
format(idstrsizeof(idstr), "id%d"i);
        
ini_getInteger(iniFile,idstrPlayerInv[playerid][i]);
    }
    for(new 
w=0;w<47;w++)
    {
        new 
weaponstr[128],a;
        
format(weaponstrsizeof(weaponstr), "weapon%d"w);
        
ini_getInteger(iniFile,weaponstra);
        
Weap_save[playerid][w] = a;
    } 
PHP код:
stock CreateAccount(playeridpassword[])
{
    new 
stringooooo[128];
    
format(stringooooosizeof(stringooooo), "/aqauntebi/%s.ini"GetName(playerid)); // Добавляем тип файла (.ini).
    
new iniFile ini_createFile(stringooooo); // Создаём файл.
    
if(iniFile 0ini_createFile(stringooooo);
    
ini_openFile(stringooooo); // Если файл выдал ошибку, то мы его откроем заного.
    
strmid(Player[playerid][pKey], password0strlen(password), 255);
    
ini_setString(iniFile"Password"Player[playerid][pKey]); // Запишем пароль в файл.
    
ini_setInteger(iniFile"Kills"0); // Запишем кол-во денег в файл.
    
ini_setInteger(iniFile"Sex"1);
    
ini_setInteger(iniFile"Level"1);
    
ini_setInteger(iniFile"Coin"0);
    
ini_setInteger(iniFile"Leader"0);
    
ini_setInteger(iniFile"Gangid"0);
    
ini_setInteger(iniFile"VIP"0);
    
ini_setInteger(iniFile"CTime"0);
    
ini_setFloat(iniFile"Blood"100.0); // Запишем кол-во жизней в файл.
    
ini_setFloat(iniFile"Temperature"36.6);
    
ini_setInteger(iniFile"Hunger"1350);
    
ini_setInteger(iniFile"Thirst"1050);
    
ini_setInteger(iniFile"Pack"1);
    
ini_setFloat(iniFile"PosX"0.0); //при авторизации узнаем координату X
    
ini_setFloat(iniFile"PosY"0.0); //при авторизации узнаем координату Y
    
ini_setFloat(iniFile"PosZ"0.0); //при авторизации узнаем координату Z
    
ini_setFloat(iniFile"FA"0.0); //при авторизации узнаем угол поворота
    
ini_closeFile(iniFile); // Закрываем файл.
    /*if(CallRemoteFunction("GetAnticheatConnect", "d", playerid) == 1)
    {*/
    
Player[playerid][pPack] = 2;
    
Player[playerid][pSlots] = 4;//т.к даем 3 вещи
    
PlayerInv[playerid][31] = 1;
    
PlayerInv[playerid][1] = 1;
    
PlayerInv[playerid][44] = 1;
    
//PlayerInv[playerid][44] = 1;
    
PlayerInv[playerid][53] = 1;
    
//}
    /*else if(CallRemoteFunction("GetAnticheatConnect", "d", playerid) == 0)
    {
        Player[playerid][pPack] = 1;
        Player[playerid][pSlots] = 3;//т.к даем 3 вещи
        PlayerInv[playerid][31] = 1;
        PlayerInv[playerid][1] = 1;
        PlayerInv[playerid][44] = 1;
    }*/
    
LoadAccount(playeridPlayer[playerid][pKey]);
    return 
1;

PHP код:
stock SaveAccount(playerid)
{
    if(
Login[playerid] == 0) return 1;
    new 
stringistavi[128],Float:fa;
    
GetPlayerFacingAngle(playeridfa);
    
GetPlayerHealth(playerid,Player[playerid][pBlood]);
    
GetPlayerArmour(playerid,Player[playerid][pArmor]);
    if(
damage_exit[playerid] > || PlayerSkin[playerid] == true)
    {
        if(
damage_exit[playerid] > 0VeshiOff(playerid);
        if(
PlayerSkin[playerid] == true)
        {
            
Player[playerid][PosX] = 0.0;
            
Player[playerid][PosY] = 0.0;
            
Player[playerid][PosZ] = 0.0;
        }
        
Player[playerid][pSex] = 1;
        
Player[playerid][pSkin] = 78;
    }
    else if(
damage_exit[playerid] < && PlayerSkin[playerid] != trueGetPlayerPos(playeridPlayer[playerid][PosX], Player[playerid][PosY], Player[playerid][PosZ]);
     new    
skin_save GetPlayerSkin(playerid);
    
format(stringistavisizeof(stringistavi), "/aqauntebi/%s.ini"GetName(playerid)); // Задаём путь к файлу
    
new iniFile ini_openFile(stringistavi); // Открываем файл.
    
if(iniFile 0iniFile ini_openFile(stringistavi); // Открываем файл.
    
for(new i=0;i<INVNUMBERS;i++)
    {
        new 
idstr[256];
        
format(idstrsizeof(idstr), "id%d",i);
        
ini_setInteger(iniFile,idstrPlayerInv[playerid][i]);
    }
    
ini_setInteger(iniFile"Kills"Player[playerid][pKillsZ]);
    
ini_setInteger(iniFile"Hunger"Player[playerid][pHunger]);
    
ini_setInteger(iniFile"Thirst"Player[playerid][pThirst]);
    
ini_setInteger(iniFile"HShots"Player[playerid][pHShots]);
    
ini_setInteger(iniFile"Pack"Player[playerid][pPack]);
    
ini_setInteger(iniFile"Sex"Player[playerid][pSex]);
    
ini_setFloat(iniFile"Blood"Player[playerid][pBlood]);
    
ini_setFloat(iniFile"Armor"Player[playerid][pArmor]);
    
ini_setFloat(iniFile"Temperature"Player[playerid][pTemp]);
    
ini_setFloat(iniFile,"PosX"Player[playerid][PosX]);
    
ini_setFloat(iniFile,"PosY"Player[playerid][PosY]);
    
ini_setFloat(iniFile,"PosZ"Player[playerid][PosZ]);
    
ini_setInteger(iniFile"Admin"Player[playerid][pAdmin]);
    
ini_setInteger(iniFile"Karma"Player[playerid][pKarma]);
    
ini_setInteger(iniFile"Level"Player[playerid][pLevel]);
    
ini_setInteger(iniFile"Gangid"Player[playerid][pGangid]);
    
ini_setInteger(iniFile"Leader"Player[playerid][pLeader]);
    
ini_setInteger(iniFile"Rank"Player[playerid][pRank]);
    
ini_setInteger(iniFile"VIP"Player[playerid][pVIP]);
    
ini_setInteger(iniFile"CTime"Player[playerid][pCTime]);
    
ini_setInteger(iniFile"Coin"Player[playerid][pCoin]);
    
ini_setInteger(iniFile"STD"Player[playerid][pSTD]);
    
ini_setInteger(iniFile"ConnectTime"Player[playerid][pConnectTime]);
    
ini_setInteger(iniFile"Death"Player[playerid][pDeath]);
    
ini_setInteger(iniFile"KillsS"Player[playerid][pKillsS]);
    
ini_setInteger(iniFile"Kill_game"Player[playerid][pKill_game]);
    
ini_setInteger(iniFile"Loot"Player[playerid][pLoot]);
    
ini_setInteger(iniFile"Noga"Player[playerid][pNoga]);
    
ini_setInteger(iniFile"Kill_s_g"Player[playerid][pKill_s_g]);
    
ini_setInteger(iniFile"Sec"Player[playerid][pSec]);
    
ini_setInteger(iniFile"Min"Player[playerid][pMin]);
    
ini_setInteger(iniFile"Hour"Player[playerid][pHour]);
    
ini_setInteger(iniFile"Skin"skin_save);
    
ini_setInteger(iniFile"Message"Player[playerid][pMessage]);
    
ini_setInteger(iniFile"Slots"Player[playerid][pSlots]);
    
ini_setInteger(iniFile"Bad"Player[playerid][pBad]);
    
ini_setFloat(iniFile,"FA"fa);
    for(new 
047++)//weap_save
    
{
        new 
weaponstr[128];
        
format(weaponstrsizeof(weaponstr), "weapon%d",f);
        
ini_setInteger(iniFile,weaponstr0);
    }
    for(new 
013++)//weap_save
    
{
        new 
w,a;
        new 
weaponstr[128];
        
GetPlayerWeaponData(playerid,s,w,a);
        if(
0)
        {
            
format(weaponstrsizeof(weaponstr), "weapon%d",w);
            
ini_setInteger(iniFile,weaponstra);
        }
        
//printf( "slot %d weapon %d ammp %d", s,w,a);
    
}
    
ini_closeFile(iniFile); // Закрываем файл.
    
return 1;

Please guys i really need this pleaseee (((
Reply
#2

If someone help me I'l give him User Control panel, which i made )))
Reply
#3

SKYPE >>> ********:arthour.p Add me and i'l show you UCP :3
Reply
#4

Sorry to burst your bubble, but no one's going to convert this code into MySQL. This section isn't for asking people to script something for you, it's for asking how to script something you're confused with or it's for asking about what's wrong with your code, not to ask someone to convert your code into something else.
Reply
#5

Information

Yeah, I don't think anyone will accept a UCP from you since you can't even read a few tutorials from the tutorial section about converting INI to SQL.

Before posting here why don't you search ****** for your question? if that fails search this forum under the tutorial section and even you can't find a tutorial ( very unlikely these days ) then you can post here for help.
Reply
#6

OOOH i didnt found Tutoriaaaal Can you give me link?
Reply
#7

Information

I apologize, I assumed someone had made one by now, I could have sworn I saw a few, a few months ago but am currently unable to find them as well.

I suggest you take a look around the mysql plugin posts and other related posts. These will help you to put the pieces together.
Reply
#8

Quote:
Originally Posted by Pearson
Посмотреть сообщение
OOOH i didnt found Tutoriaaaal Can you give me link?
There are tutorials for both yini scripting and MySQL implementation in SAMP. Read them, understand them and convert it by yourself.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)