Small problem -
StR_MaRy - 01.12.2015
hi if i have those scripts and i want to make them on mysql can some1 give me an idea?
INI_Int("Vehicle1",PlayerInfo[playerid][pVehicle1]);
INI_Float("Vehicle1X",PlayerInfo[playerid][pVehicle1X]);
INI_String("Vehicle1Plate",PlayerInfo[playerid][pVehicle1Plate]);
and this thoo
INI_WriteInt(File,"Vehicle1",PlayerInfo[playerid][pVehicle1]);
INI_WriteFloat(File,"Vehicle1X",PlayerInfo[playerid][pVehicle1X]);
INI_WriteString(File,"Vehicle1Plate",PlayerInfo[playerid][pVehicle1Plate]);pls i don't know how to make them work with mysql
Re: Small problem -
CmZxC - 01.12.2015
If you don't know how to make simple things like that in MySQL, you are better off either learning atleast basic functions of it or not using it at all.
Account system with MySQL tutorial by Overhaul covers alot of ground on mysql, you can find out how to use most of the functions you need from his guide found
HERE(click).
Re: Small problem -
MBilal - 01.12.2015
You need to make colums in mysql with same name like
Vehicle1 / Vehiclex etc .
then like this is Example
Код:
new query[128];
mysql_format(mysql, query, sizeof(query),"UPDATE `players` SET `Vehicle1`=%d,`Vehicle1X`=%f WHERE `ID`=%d", PlayerInfo[playerid][pVehicle1],PlayerInfo[playerid][pVehicle1X],pInfo[playerid][PDID]);
mysql_tquery(mysql, query );
this was just example you can save other like this.
Re: Small problem -
Vince - 01.12.2015
One rule that you should keep in mind is: columns should never* have a number in their name. If they have then the database model is wrong. And contrary to what MBilal says above you need to make
rows, not columns. If
one vehicle is owned by
one player, and one player only then the table, separate from that of the player one, should look somewhat like:
id | ownedBy | model | x | y | z |
1 | 5 | 411 | 1247.12 | -147.31 | 12.02 |
7 | NULL | 500 | 2487.97 | 1578.56 | 13.57 |
8 | 1 | 562 | -2478.86 | -2047.12 | 25.36 |
where ownedBy is linked to a specific player. So if you have a player entry somewhat like this:
Then you know that vehicle 8 is owned by Bob, because Bob has id 1.
*There are certain exceptions, but they are few. Doing something like color1 and color2 for car colors is fine, but I can't think of
anything else right now.