MySQL weapon shop system (question about massive columned table)
#1

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.
Reply
#2

ahh, Weapon Shop yeah? But why would you use MySQL for it? Why don't you just use GiveplayerWeapon?
Reply
#3

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
Reply
#4

How is this supposed to work? Because this is most certainly not the way to do it.
Reply
#5

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
Reply
#6

use a table for weapons:

PHP код:
CREATE TABLE player_weapons (
  
id INT NOT NULL AUTO_INCREMENT,
  
player INT,
  
weapon TINYINT,
  
ammo INT,
  
PRIMARY KEY (playerweapon),
  
CONSTRAINT FOREIGN KEY (playerREFERENCES my_playerid_table(idON DELETE CASCADE
); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)