SA-MP Forums Archive
Faction Cars - 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: Faction Cars (/showthread.php?tid=657145)



Faction Cars - Zeus666 - 01.08.2018

Hi. I made a custom basic faction system, via mysql

PHP код:
enum playerinfo
{
pFaction
............ 
but my question is how can I make faction cars?

shall I add them inside of MYSQL? i can create "factioncar" table, and as rows i can create

PHP код:
 carid,  carXcarYcarZ,  carcolorcarcolor2licenseplate 
is that a good ideea?

but then what?


Re: Faction Cars - GRiMMREAPER - 01.08.2018

Sounds good to me; I just don't understand what else you expect us to tell you with "but then what?". Create a command (e.g: /buyfcar) that adds a vehicle to that table.


Re: Faction Cars - Zeus666 - 01.08.2018

And how can I make script to put into the game the car id's from mysql?

also how can I set to make "factionvehicle" to be usable only by pFaction == 1?


Re: Faction Cars - GRiMMREAPER - 01.08.2018

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
And how can I make script to put into the game the car id's from mysql?

also how can I set to make "factionvehicle" to be usable only by pFaction == 1?
Make sure the carid column is of type INTEGER, is the PRIMARY KEY and is set to AUTO_INCREMENT (I know for a fact that SQLite will automatically AUTOINCREMENT INTEGERS set to be PRIMARY KEYs, but I'm not sure if MySQL does).

Take a look at OnPlayerEnterVehicle.