Best way to store objects in mySQL
#1

I'm currently making a bases system. The base info is held in a mySQL table (Name, price, coordinates)..

I want the user to be able to unlock different objects for the base. Is there a way the user himself could buy & move the objects? I once saw a system where you could move the object, rotate the object etc. with an on-screen GUI.

Anyways.. if not, I would like to add the objects myself and the user can just 'unlock them' (make them visible). What's the best way to store maybe.. 10-15 objects? Should I make a different database for the objects or somehow put them into the base mySQL table?

Thanks
Reply
#2

I think you need this: https://sampwiki.blast.hk/wiki/EditObject
Reply
#3

As for mysql, you should create a separate table for them:

Код:
CREATE TABLE IF NOT EXISTS base_objects (
    id INT AUTO_INCREMENT NOT NULL,
   base_id INT NOT NULL,
   object_id INT NOT NULL,
   x FLOAT NOT NULL,
   y FLOAT NOT NULL,
   z FLOAT NOT NULL,
   rot_x FLOAT NOT NULL,
   rot_y FLOAT NOT NULL,
   rot_z FLOAT NOT NULL,
   unlocked TINYINT UNSIGNED NOT NULL,
   PRIMARY KEY(id)
);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)