Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Debian on Sep 13, 2015, 10:04 AM

Title: Wep stats? Large database
Post by: Debian on Sep 13, 2015, 10:04 AM
I made a wep stats but it has large database like 32 queries and i made it to store the values in a array , So that means each time when a player logins it makes 32 queries at a time . Does that make a lot of lag? any way to make it better?
Title: Re: Wep stats? Large database
Post by: Thijn on Sep 13, 2015, 10:14 AM
Would be easily possible with just 1 query. Show your code.
Title: Re: Wep stats? Large database
Post by: Debian on Sep 13, 2015, 10:55 AM
Yes, i just got wrong meaning of query , its 1query but when player registers ,query inserts 32 items, and when player exits query updates 32 items,  when player types /wstats cmd

::QuerySQL( dbGlobal, "INSERT INTO Wstats ( NameLower, Fist, BrassKnuckle, ScrewDriver, GolfClub, NightStick, Knife, BaseballBat, Hammer, Cleaver, Machete, Katana, Chainsaw, Grenade, RemoteGrenade, TearGas, Molotov, Missile, Colt45, Python, Shotgun, Spaz , Stubby, Tec9, Uzi, Ingrams, MP5, M4, Ruger, SniperRifle, LaserScope, RocketLauncher, FlameThrower, M60 ) VALUES ( '" + player.Name.tolower() + "', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )" );
Title: Re: Wep stats? Large database
Post by: Thijn on Sep 13, 2015, 11:00 AM
In that case it wont lag that much.