SA-MP Forums Archive
How can i do this? - 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: How can i do this? (/showthread.php?tid=150264)



How can i do this? - NewTorran - 25.05.2010

How can i do this?

Explanation:
In my MySQL table i have these:



VehName
XCoord
YCoord
ZCoord
Angle


Veh1
Veh2
Veh3
Veh4
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0000
0.0000
0.0000
0.0000



Theres models aswell but that was just a quick example, Anyways:

How would i get those coordinates and create the vehicles using them coords?



Re: How can i do this? - Grim_ - 25.05.2010

Look over the basics of MySQL.
Just select the information and see what it returns, then load it into variables to set up in the function.


Re: How can i do this? - NewTorran - 25.05.2010

Quote:
Originally Posted by Grim_
Look over the basics of MySQL.
Just select the information and see what it returns, then load it into variables to set up in the function.
Yeye this bit isent really to do with MySQL.
I dont know how to create 4 vehicles with those 4 rows of coords
Or if someone adds lets say 4/5 more rows of coords and models
Then for it to create 8 vehicles


Re: How can i do this? - NewTorran - 26.05.2010

Anyone?


Re: How can i do this? - dice7 - 26.05.2010

You retrieve data from your table with SQL statements. Learn them and check the topic of your mqsql plugin to see how to query the db to get the data from your table. Then just parse the string with something like sscanf to get the name and floats


Re: How can i do this? - NewTorran - 26.05.2010

Quote:
Originally Posted by dice7
You retrieve data from your table with SQL statements. Learn them and check the topic of your mqsql plugin to see how to query the db to get the data from your table
I know how to get all the information,
I just dont know how to create the vehicles,
So like if i had 4 rows of coords, it would create 4 vehicles using them coords,
If i had 7 rows, then 7 vehicles