SA-MP Forums Archive
Save player attached objects. - 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: Save player attached objects. (/showthread.php?tid=550655)



Save player attached objects. - Banditukas - 14.12.2014

Hi,

I want to save attach object when player disconnect and load when player connect. I will need model x,y,z,rx,ry,rz,px,py,pz slot. I have all that in variables. But now i'am using mysql and i don't know how now with tables. Maybe possible to create 10 tables, because 10 slots is avaible and there write information and when load read all separately. Because now i have to create for 10 slots. How i said model,slot,x,y,yz.... 12 options 12 * 10 = 120.


Re: Save player attached objects. - Pottus - 14.12.2014

Create 1 table like this.
PlayerName, CostumeIndex, CostumeSlot, bone, x, y, z, rx, ry, rz, px, py, pz

Then just use the right queries.

Get a specific costume
SELECT * FROM `CostumeData` WHERE `PlayerName` = '%s' AND `CostumeIndex` = index

Get all unique costumes
SELECT DISTINCT `CostumeIndex` FROM `CostumeData` WHERE `PlayerName` = '%s'


Re: Save player attached objects. - Banditukas - 14.12.2014

But there is 9 slots, and i already have a players table where player information is i want to make there everything.