Question MySQL
#1

Hi sa-mp.com! I have a question. I am newbie in MySQL, but i want to learn. I have Vortex Roleplay GAMEMODE and i didn't know how to add a new field in accounts (pCarLicence is the field). Please help me.
Reply
#2

bump..
Reply
#3

Add it in to the player array, reset it in the player variable reset function, add it to the table using a database admin tool (such as phpMyAdmin), CTRL+F for 'THREAD_CHECK_CREDENTIALS' and add somewhere in the code sequence:

pawn Код:
mysql_get_field("playerLicense", result); // Replace where appropriate.
playerVariables[extraid][pCarLicense] = strval(result); // Replace where appropriate.
Now for the saving of the variable, savePlayerData(const playerid), add somewhere in to the format queries, preferably in this one:

pawn Код:
format(saveQuery, sizeof(saveQuery), "%s, playerCarTrunk1 = '%d', playerCarTrunk2 = '%d', playerPhoneCredit = '%d', playerWalkieTalkie = '%d'", saveQuery, playerVariables[playerid][pCarTrunk][0], playerVariables[playerid][pCarTrunk][1], playerVariables[playerid][pPhoneCredit], playerVariables[playerid][pWalkieTalkie]);
Add the following code inside the format, after '%s, ' (replace where appropriate):
pawn Код:
playerLicense = %d,
And add to the format after 'saveQuery,' (replace where appropriate)
pawn Код:
playerVariables[playerid][pCarLicense],
Now your variable (if it's an integer) should save when a player logs off and load when a player logs back in.
Reply
#4

How to add in database?
Reply
#5

Somebody know?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)