#Car System
9 messages Ā· Page 1 of 1 (latest)
By coding it
An upcoming multiplayer mod for Grand Theft Auto: San Andreas that will be fully backwards compatible with the existing multiplayer mod San Andreas Multiplayer.
Helps alot, the reason i am asking is, i've read through the docs already, i'm familiar with basics, the problem is mysql, i cant set it up to pull the model id from the DB to get used when spawning a vehicle, thats my problem, and thats why i asked
If you can't make it, pay to someone else.
The thing is i want to learn how to do these kinds of stuff, as i said this is just for fun, and to learn, i dont plan on making this server something
Glad it helps a lot!
What's there to say, though? If you have scripting/programming experience, learn pawn (read pawn documentation and such). If you don't have any scripting experience yet you're maybe better off finding existing scripts, try to understand them, alter them or maybe attempt to remake them. (And also then, read docs). https://raw.githubusercontent.com/compuphase/pawn/master/doc/Pawn_Language_Guide.pdf
We could tell you how to create a car ownership script and car spawning system but creating it your own is so much better for the sake of learning (and more fun).
"creating it your own is so much better for the sake of learning (and more fun)." This i completelyagree, just that i cant figure it out for the life of me, i have read a little bit of Pawn documentation, and i've been through a lot, and i mean a lot, of other scripts, i do understand most of the stuff in them, but never to the point of figuring out the system im aiming for.
Well, here's a few links to help you on the way then.
https://github.com/pBlueG/SA-MP-MySQL/wiki - Wiki of the MySQL plugin for SA-MP. If you didn't download that plugin yet, you can fetch it from the releases page
https://sampwiki.blast.hk/wiki/CreateVehicle - Function to spawn vehicles - see related functions as well)
And in case you want some kind of example:
https://pastebin.com/Xecfs975 - Some random vehicle dealership filterscript I found via Google. Few notes after a quick look:
- Try not to use unthreaded queries like this script does (see:
mysql_tquery()on mysql plugin wiki) - This script is intended as a filterscript. Therefor all functions declared with
stockprobably should not had been declared withstock. See pawn language guide if you have not idea whatstockdoes - You might want to use y_commands instead of zcmd. You can grab the YSI library here: https://github.com/pawn-lang/YSI-Includes (which comes with many many many more benefits, such as support for inline functions for MySQL threaded queries, eg https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Coding/y_inline/features.md#login-dialog and hooking functions)
- Player variable names (PVar functions) in this script are stupid. Also, you might want to use regular variables instead.
If this doesn't help you in the proper direction... then I have no idea what will :-)
Oh and also:
https://www.open.mp/docs/scripting/language/Style