SA-MP Forums Archive
Account ids? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Account ids? (/showthread.php?tid=581118)



Account ids? - Mouiz - 10.07.2015

This is my server's account system:

PHP код:
public LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Password",PlayerInfo[playerid][pPass]);
    
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    
INI_Int("Vip",PlayerInfo[playerid][pVip]);
    
INI_Int("PM",PlayerInfo[playerid][Pms]);
    
INI_Int("Gos",PlayerInfo[playerid][Gos]);
    
INI_Int("God",God[playerid]);
    
INI_Int("MegaJump",MegaJump[playerid]);
    
INI_Int("Skin",PlayerInfo[playerid][pSkin]);
    
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_Int("Score",PlayerInfo[playerid][pScore]);
    
INI_Int("FreeRoam_Score",PlayerInfo[playerid][pKills]);
    
INI_Int("Deathmatch_Score",PlayerInfo[playerid][pDeathmatchScore]);
    
INI_Int("Cash",PlayerInfo[playerid][pCash]);
    
INI_Int("Coins"PlayerInfo[playerid][pCoins]);
    
INI_Int("Muted",PlayerInfo[playerid][pMuted]);
    
INI_Int("Cage",PlayerInfo[playerid][cage]);
    
INI_Int("Freeze",PlayerInfo[playerid][Freeze]);
    
INI_Int("Jail",PlayerInfo[playerid][Jail]);
    
INI_Int("Banned"PlayerInfo[playerid][Banned]);
    
INI_Int("Invisible"PlayerInfo[playerid][Invisible]);
    
INI_Int("Warn"PlayerInfo[playerid][Warn]);
    return 
1;

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"IP",PlayerInfo[playerid][pIP]);
    
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    
INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
    
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
    
INI_WriteInt(File,"PM",PlayerInfo[playerid][Pms]);
    
INI_WriteInt(File,"Gos",PlayerInfo[playerid][Gos]);
    
INI_WriteInt(File,"God",God[playerid]);
    
INI_WriteInt(File,"MegaJump",MegaJump[playerid]);
    
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_WriteInt(File,"Freeroam_Score",PlayerInfo[playerid][pKills]);
    
INI_WriteInt(File,"Deathmatch_Score",PlayerInfo[playerid][pDeathmatchScore]);
    
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    
INI_WriteInt(File,"MFEP",PlayerInfo[playerid][pCoins]);
    
INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted]);
    
INI_WriteInt(File,"Jail",PlayerInfo[playerid][Jail]);
    
INI_WriteInt(File,"Cage",PlayerInfo[playerid][cage]);
    
INI_WriteInt(File,"Freeze",PlayerInfo[playerid][Freeze]);
    
INI_WriteInt(File,"Banned"PlayerInfo[playerid][Banned]);
    
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBan]);
    
INI_WriteInt(File,"Invisible"PlayerInfo[playerid][Invisible]);
    
INI_Close(File);

PHP код:
    if(dialogid == DIALOG_REGISTER)
        {
            if (!
response) return PlayerInfo[playerid][pLogged] = 0;
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""COL_WHITE"Registering",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new 
INI:File INI_Open(UserPath(playerid));
                
PlayerInfo[playerid][pPass] = udb_hash(inputtext);
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Cash",0);
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Vip",0);
                
INI_WriteInt(File,"Score",0);
                
INI_WriteInt(File,"Skin",0);
                
INI_WriteInt(File,"Banned",0);
                
INI_WriteInt(File,"IP"0);
                
INI_WriteInt(File,"Freeroam_Score",0);
                
INI_WriteInt(File,"Deaths",0);
                
INI_WriteInt(File,"Weather",0);
                
INI_WriteInt(File,"Time",0);
                
INI_WriteInt(File,"SaveSkin",0);
                
INI_WriteInt(File,"UseSkin",0);
                
INI_WriteInt(File,"MFEP",0);
                
INI_WriteInt(File,"Muted",0);
                
INI_WriteInt(File,"Pms",0);
                
INI_WriteInt(File,"Gos",0);
                
INI_WriteInt(File,"God",0);
                
INI_WriteInt(File,"Deathmatch_Score",0);
                
INI_WriteInt(File,"Jail",0);
                
INI_WriteInt(File,"cage",0);
                
INI_WriteInt(File,"Freeze",0);
                
INI_WriteInt(File,"Banned",0);
                
INI_WriteInt(File,"Invisible",0);
                
INI_Close(File);
                
PlayerInfo[playerid][pLogged] = 1;
                
SetSpawnInfo(playerid00, -1680.1483,706.0532,30.6016,90.9011000000);
                
SendClientMessage(playeridCOLOR_RED"Account Registered");
                
SendClientMessage(playeridCOLOR_RED"You have logged in your account");
                
ForceClassSelection(playerid);
            }
        } 
And i want to make an account id system,help please


Re: Account ids? - Vince - 10.07.2015

Account ids are pointless if you use a file system.


Re: Account ids? - Mouiz - 10.07.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
Account ids are pointless if you use a file system.
But i need it


Re: Account ids? - IndependentGaming - 10.07.2015

Try to re script your account system into mysql its much beter and then you dont need it.


Re: Account ids? - Mouiz - 10.07.2015

Quote:
Originally Posted by SacrificeGaming
Посмотреть сообщение
Try to re script your account system into mysql its much beter and then you dont need it.
Cant anyone just add an account id system in this?


Re: Account ids? - Threshold - 10.07.2015

The only time you'll ever be able to use account ids, is if you're using a system like MySQL where you can make queries to a database. You will not find any efficient 'account id' methods with y_ini or any other file system.


Re: Account ids? - Vince - 10.07.2015

Quote:
Originally Posted by Mouiz
Посмотреть сообщение
But i need it
Why?


Re: Account ids? - Mouiz - 11.07.2015

Quote:
Originally Posted by Threshold
Посмотреть сообщение
The only time you'll ever be able to use account ids, is if you're using a system like MySQL where you can make queries to a database. You will not find any efficient 'account id' methods with y_ini or any other file system.
If thats it so i am the king of the the best scripters because i made an account id system from it without mysql


Re: Account ids? - Threshold - 11.07.2015

Okay. So explain to me. If a player enters, how do you determine what their account ID is? Do you loop through all account IDs to see which name you have saved? If so, then what is the difference between that and making files with a player's name instead? Rendering your 'account id system' completely void and useless.

I didn't say it wasn't possible, I said you wouldn't have any reason to use it other than with MySQL.


Re: Account ids? - Mouiz - 11.07.2015

Quote:
Originally Posted by Threshold
Посмотреть сообщение
Okay. So explain to me. If a player enters, how do you determine what their account ID is? Do you loop through all account IDs to see which name you have saved? If so, then what is the difference between that and making files with a player's name instead? Rendering your 'account id system' completely void and useless.

I didn't say it wasn't possible, I said you wouldn't have any reason to use it other than with MySQL.
I will save the number of account ids in ServerInfo -_-