SA-MP Forums Archive
MySQL BlueG Add - 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: MySQL BlueG Add (/showthread.php?tid=656986)



MySQL BlueG Add - KamilPolska - 29.07.2018

What is a good way to add money, level after player registration. At login he gives, but after registration he does not. How to make? I'm doing RolePlay gamemode.
Player[playerid][Money]
Player[playerid][Level]


Re: MySQL BlueG Add - Libbyphay - 29.07.2018

Quote:
Originally Posted by KamilPolska
Посмотреть сообщение
What is a good way to add money, level after player registration. At login he gives, but after registration he does not. How to make? I'm doing RolePlay gamemode.
Player[playerid][Money]
Player[playerid][Level]
Add on your gamemode:

PHP код:
enum pData
{
    
Money,
    
Level;
}
new 
Player[MAX_PLAYERS][pData]; 
PHP код:
Add on your gamemode when login successit is examp of me.
Load_PlayerData(playerid)
{
    
cache_get_value_int(0"Money"Player[playerid][Money]);
    
cache_get_value_int(0"Level"Player[playerid][Level]);
    return 
1;

PHP код:
public OnPlayerUpdate(playerid)
{
    if(
GetPlayerScore(playerid) != Player[playerid][Level])
    {
        
SetPlayerScore(playeridPlayer[playerid][Level])
    }
    if (
GetPlayerMoney(playerid) != Player[playerid][Money])
    {
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridPlayer[playerid][Money]);
    }
    return 
1;




Re: MySQL BlueG Add - KamilPolska - 29.07.2018

I think I have misinterpreted. I wanted so that after registration, I login in to my account without entering a login password, get money = 5000, level = 1, skinid, adminlvl = 0. I have OnAccountCheck, CreateAccount,OnAccountCreate, AssignPlayerData, SaveAccount, ResetPlayerData


Re: MySQL BlueG Add - Libbyphay - 29.07.2018

Quote:
Originally Posted by KamilPolska
Посмотреть сообщение
I think I have misinterpreted. I wanted so that after registration, I login in to my account without entering a login password, get money = 5000, level = 1, skinid, adminlvl = 0. I have OnAccountCheck, CreateAccount,OnAccountCreate, AssignPlayerData, SaveAccount, ResetPlayerData
Add on enum
PHP код:
Money,
Level,
Adminlvl
Add on AssignPlayerData
PHP код:
cache_get_value_int(0"Money"Player[playerid][Money]);
cache_get_value_int(0"Level"Player[playerid][Level]);
cache_get_value_int(0"Adminlvl"Player[playerid][Adminlvl]); 
Add on SaveAccount same as your gamemode i forgeted mysql_tquery.
Add on ResetPlayerData
PHP код:
Player[playerid][Money] = 5000;
Player[playerid][Level] = 1;
Player[playerid][Adminlvl]  = 0
If i helped you, don't forget +rep me.


Re: MySQL BlueG Add - KamilPolska - 30.07.2018

//del


Re: MySQL BlueG Add - GTLS - 01.08.2018

Nice rep hunting tho.

Anyway,

Okay, So I understand you want to give players some default money and level when they register for the first time right?

What you can do is, Under OnDialogResponse -> Register Dialog, under if(response) you can set the values for those variables what ever you want and when a player spawns, he will have that much money.


Re: MySQL BlueG Add - KamilPolska - 06.08.2018

Thanks, GTLS !