Skip to content
View in the app

A better way to browse. Learn more.

GTAGames.nl - De Nederlandse Grand Theft Auto Community!

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Variables mixen door elkaar (probleem)

Hallo,

Je zult wel weer denken "daar isdie weer met zo'n lastige vraag". Maar de vraag moet nog ontdekt worden.

Het probleem is wel bekent.

Ik heb de afgelopen 3 weken me verdiept in mysql en ken nu wel zo'n beetje de basis. Toch zit ik met het volgende probleem:

- Mijn script laad de player variables met mysql

- Mijn script slaat de vairables op met mysql

- Mijn script verandert de variables met mysql.

Zodra ik registreer zijn de variables niet allemaal goed, money hoort 500 te zijn maar is 0. Faction hoort 999 te zijn maar is 500 (de variable van money).

Hier gaat dus al wat fout, en we zijn nog niet eens begonnen!

Zodra ik uitlogt inlog en weer uitlog weet mijn mysql database het echt niet meer.

Bank is 0 geworden (hoort 500 te zijn) wallet is 200 en hoort 300 te zijn. Adminlevel is 500 (de integer van bank) enzovoorts.

Is dit een bekend probleem/ weet jij wat ik moet doen?

M.v.g,

Rutger.

Featured Replies

Zonder code (queries) kunnen wij daar ook vrij weinig mee.

  • Author

Ik denk dat de info hier beneden genoeg is:

Accounts saven (updaten)

    format(string,sizeof(string), "UPDATE Accounts SET AdminLevel=%i,Money=%i,Bank=%i,Faction=%i,Rank=%i,HouseKey=%i,BizKey=%i,Skin=%i,Spawn1='%f',Spawn2='%f',Spawn3='%f',Spawn4='%f',Spawn5=%i,Reg=%i,Sex=%i,Wallet=%i,Renting=%i,Products=%i,PhoneNumber=%i,Minutes=%i,Spawn6=%i,Arrested=%i,Prisoned=%i,Jailed=%i,JailTime=%i, \
Cell=%i,Towe=%i,License=%i,Linked=%i,ForumName='%s',ForumPassword='%s',wLicense=%i,Job=%i,Donator=%i,CarParts=%i,PlayingTime=%i,FightingStyle=%i WHERE Name = '%s'",
   AccountData[playerid][AdminLevel],GetPlayerCash(playerid),AccountData[playerid][bank],
AccountData[playerid][Faction],AccountData[playerid][Rank],AccountData[playerid][HouseKey],
AccountData[playerid][bizKey],GetPlayerSkin(playerid),AccountData[playerid][spawn][0],AccountData[playerid][spawn][1],AccountData[playerid][spawn][2],AccountData[playerid][spawn][3],
AccountData[playerid][interiorSpawn],AccountData[playerid][Reg],AccountData[playerid][sex],GetPlayerWalletCash(playerid),AccountData[playerid][Renting],AccountData[playerid][Products],
AccountData[playerid][PhoneNumber],AccountData[playerid][Minutes],AccountData[playerid][WorldSpawn],AccountData[playerid][Arrested],AccountData[playerid][Prisoned],AccountData[playerid][Jailed],
AccountData[playerid][JailTime],AccountData[playerid][Cell],AccountData[playerid][Towe],AccountData[playerid][License], AccountData[playerid][Linked], AccountData[playerid][ForumName],
AccountData[playerid][ForumPassword],AccountData[playerid][wLicense],AccountData[playerid][pJob], AccountData[playerid][Donator], AccountData[playerid][CarParts], AccountData[playerid][PlayingTime],
AccountData[playerid][FightingStyle],GetUserName(playerid));
mysql_query(string, MYSQL_SAVE_USERS);

Account maken:

	mysql_real_escape_string(password, SQLEscape[Escape][0]);
format(string,sizeof(string), "INSERT INTO Accounts (Name, Password, AdminLevel, Money, Bank, Faction, Rank, HouseKey, BizKey, Skin, Spawn1, Spawn2, Spawn3, Spawn4, Spawn5, Reg, Sex, Wallet, Renting, PhoneNumber, Minutes, Cell) VALUES('%s',md5('%s'), 0,500,500,999,999,999,999,101, 1981.7389,-1962.9572,16.6941, 359.3499, 0,0, 300, 500,200,0, 0, 1)",
name, SQLEscape[Escape][0]);
mysql_query(string);

Alles in de mysql log is goed (succesfully executed). Toch verandert hij de variables de heletijd, althans hij switch deze.

MYSQL Log: Aanmaken account:

[21:00:36] CMySQLHandler::ProcessQueryThread(UPDATE Accounts SET AdminLevel=0,Money=500,Bank=500,Faction=500,Rank=999,HouseKey=999,BizKey=999,Skin=101,Spawn1='0.000000',Spawn2='0.000000',Spawn3='0.000000',Spawn4='0.000000',Spawn5=0,Reg=1,Sex=1,Wallet=200,Renting=0,Products=0,PhoneNumber=1,Minutes=999,Spawn6=0,Arrested=0,Prisoned=0,Jailed=0,JailTime=0, Cell=0,Towe=0,License=0,Linked=0,ForumName='',ForumPassword='',wLicense=0,Job=0,Donator=0,CarParts=0,PlayingTime=0,FightingStyle=0 WHERE Name = 'Charles Luton') - Data is getting passed to OnQueryFinish() - (Threadsafe: Yes)

Opnieuw uitloggen:

[21:04:16] CMySQLHandler::ProcessQueryThread(UPDATE Accounts SET AdminLevel=1,Money=0,Bank=400,Faction=500,Rank=500,HouseKey=999,BizKey=999,Skin=101,Spawn1='1975.704589',Spawn2='-1965.959838',Spawn3='15.785546',Spawn4='206.144805',Spawn5=0,Reg=1,Sex=300,Wallet=0,Renting=1,Products=999,PhoneNumber=0,Minutes=999,Spawn6=0,Arrested=0,Prisoned=0,Jailed=0,JailTime=0, Cell=0,Towe=0,License=0,Linked=0,ForumName='',ForumPassword='',wLicense=0,Job=0,Donator=0,CarParts=0,PlayingTime=1,FightingStyle=0 WHERE Name = 'Charles Luton') - Data is getting passed to OnQueryFinish() - (Threadsafe: Yes)

Voor het inloggen neemt hij natuurlijk de variabelen van de log uit code.

Edited by 1112rutger

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.