Loading object from database - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Loading object from database (
/showthread.php?tid=212009)
Loading object from database -
vardanega - 16.01.2011
Hello, I would like to create a system object by loading database.
I tried to create more code with loops but nothing works no object load.
I do not know if I have to do a query object or a query for all the objects I want to use.
Here above all the structure of my table 'objects'
Код:
CREATE TABLE IF NOT EXISTS `objets` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id unique de l'objet',
`mapid` int(11) NOT NULL, COMMENT 'Id de la map au quelle appartient objets',
`modelid` int(11) NOT NULL DEFAULT '-1',
`FloatX` float NOT NULL DEFAULT '0',
`FloatY` float NOT NULL DEFAULT '0',
`FloatZ` float NOT NULL DEFAULT '0',
`FloatrX` float NOT NULL DEFAULT '0',
`FloatrY` float NOT NULL DEFAULT '0',
`FloatrZ` float NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
Here is the code that I find to pawn objects by loading loop but the problem is that I do not want to use 'sscanf' or something like that so I tried to change but I do not understand.
http://pastebin.com/uhviMbqD
Thank you anyway for the help you can give me.
Vince
Re: Loading object from database -
armyoftwo - 16.01.2011
if you don't want to use sscanf, you can use strtok or explode
Re : Loading object from database -
vardanega - 16.01.2011
and he can show me a model?