MySQL weapon shop system (question about massive columned table) - 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 weapon shop system (question about massive columned table) (
/showthread.php?tid=635883)
MySQL weapon shop system (question about massive columned table) -
Lirbo - 15.06.2017
I made a system of weapon shop but a lot of columns are required, a column for each weapon.
the more columns you got the slower it works, what should I do because i've got like 37 weapons there.
I mean i thought about making user_melee, user_pistols, user_shotguns, user_smg tables, but idk if it would be effective if it's just system that has so many columns.
Re: MySQL weapon shop system (question about massive columned table) -
JasonRiggs - 15.06.2017
ahh, Weapon Shop yeah? But why would you use MySQL for it? Why don't you just use GiveplayerWeapon?
Re: MySQL weapon shop system (question about massive columned table) -
Lirbo - 15.06.2017
Quote:
Originally Posted by JasonRiggs
ahh, Weapon Shop yeah? But why would you use MySQL for it? Why don't you just use GiveplayerWeapon?
|
Perma weapon shop
Re: MySQL weapon shop system (question about massive columned table) -
Vince - 15.06.2017
How is this supposed to work? Because this is most certainly not the way to do it.
Re: MySQL weapon shop system (question about massive columned table) -
Lirbo - 30.06.2017
Quote:
Originally Posted by Vince
How is this supposed to work? Because this is most certainly not the way to do it.
|
you buy a weapon that will be given to you everytime you spawn, it's just like 1 time purchase, and you can buy more for more bullets.
so i gotta save the weapons in the database somehow
Re: MySQL weapon shop system (question about massive columned table) -
OneDay - 30.06.2017
use a table for weapons:
PHP код:
CREATE TABLE player_weapons (
id INT NOT NULL AUTO_INCREMENT,
player INT,
weapon TINYINT,
ammo INT,
PRIMARY KEY (player, weapon),
CONSTRAINT FOREIGN KEY (player) REFERENCES my_playerid_table(id) ON DELETE CASCADE
);