How-To
#6

Hello there.
I will respond to all your questions from this topic in the following sentences and examples.
I see that you use YINI so, here is it.

1. When a player register:
- The player that joins the server must type his password, right ?
- So, you must reset all the player variables from your "pInfo" i think, that's the name of your enum.
- To reset them you must have something like this into your "DIALOG_REGISTER" (your register dialog) after he enter his pass:

PHP код:
new INI:File INI_OpenUserPathplayerid ) );
INI_SetTagFile"data" );
INI_WriteIntFile"Password"inputtext );
INI_WriteIntFile"Cash");
INI_WriteIntFile"Admin");
INI_WriteIntFile"Kills");
INI_WriteIntFile"Deaths")
INI_CloseFile 
2. When a player login:
- So, you must know that when a player login is not the same thing with when a player register, i think u get that already.
- And if you know, you must load their dates from their own paths from your scriptfiles folder from folder "Users" or another folder that contain your player paths.
- So after the enteres his password into the "DIALOG_LOGIN" (your login dialog) you must have something like this:

PHP код:
INI_Int"Password"PlayerInfoplayerid ][ pPass ] );
INI_Int"Cash"PlayerInfoplayerid ][ pCash] );
INI_Int"Admin"PlayerInfoplayerid ][ pAdmin] );
INI_Int"Kills"PlayerInfoplayerid ][ pKills] );
INI_Int"Deaths"PlayerInfoplayerid ][ pDeaths ] ); 
So, that's all that you must to know when you want to make another variables that stores another things into the player path.
You said that you want to add "Score", yea that's ok. At your enum "pInfo" you added: "pScore", after that you will name this into the player path "Score". You asked if this is a problem, this is not a problem, at all. All you must to do is to add at your register dialog this: "INI_WriteInt( File, "Score", 0 )", and at your login dialog (Load Player Dates Function or another function that loads dates) this: "INI_Int( "Score", PlayerInfo[ playerid ][ pScore ] ), SetPlayerScore( playerid, PlayerInfo[ playerid ][ pScore ] );"

ALSO, VERY IMPORTANT:
1. At "OnPlayerDisconnect" you must save the player variables (dates) before you reset them or another things. Example here:

PHP код:
public OnPlayerDisconnectplayeridreason )
{
    new 
INI:File INI_OpenUserPathplayerid ) );
    
INI_SetTagFile"data" );
    
INI_WriteIntFile,"Cash"GetPlayerMoneyplayerid ) );
    
INI_WriteIntFile,"Admin"PlayerInfoplayerid ][ pAdmin ] );
    
INI_WriteIntFile,"Kills"PlayerInfoplayerid ][ pKills ] );
    
INI_WriteIntFile,"Deaths"PlayerInfoplayerid ][ pDeaths ] );
    
INI_CloseFile );
    
    return 
1;

I hope you get all the informations that i gave you here.
Reply


Messages In This Thread
How-To - by Lixyde - 27.03.2018, 09:25
Re: How-To - by ForCop - 27.03.2018, 09:35
Re: How-To - by Lixyde - 27.03.2018, 17:04
Re: How-To - by jasperschellekens - 27.03.2018, 17:34
Re: How-To - by Lixyde - 27.03.2018, 17:50
Re: How-To - by FaLLenGirL - 27.03.2018, 18:54
Re: How-To - by Lixyde - 28.03.2018, 16:16

Forum Jump:


Users browsing this thread: 2 Guest(s)