16.10.2013, 12:22
Hello.
Well, I have a system of vehicles, when I bought one, the vehicle added fine, but in the database in the "Owner" column, it puts "Free" instead of putting the player name.
Help?
Well, I have a system of vehicles, when I bought one, the vehicle added fine, but in the database in the "Owner" column, it puts "Free" instead of putting the player name.
pawn Код:
public Vehicule_data_add(playerid, model)
{
new Requete[MAX_STRING], vehid;
format(Requete, sizeof(Requete), "INSERT INTO lsrp_vehiculesdata SET `Model`='%d'", model);
mysql_query(Requete);
Vehiculedata_infos[vehid][v_posX] = 1364.841;
Vehiculedata_infos[vehid][v_posX] = -2316.2483;
Vehiculedata_infos[vehid][v_posZ] = 13.3005;
Vehiculedata_infos[vehid][v_posA] = 270.3969;
Vehicule_data_update(vehid);
return 1;
}
pawn Код:
public Vehicule_data_update(id)
{
new Requete[512], ProprioCar[24];
mysql_real_escape_string(Vehicule_infos[id][v_Proprio], ProprioCar);
format(Requete, sizeof(Requete), "UPDATE lsrp_vehiculesdata SET `Model`='%d', `Proprio`='%s', `X`='%f', `Y`='%f', `Z`='%f', `A`='%f', `Color1`='%d', `Color2`='%d', `Type`='%d', `mLock`='%d', `VirtualWorld`='%d', `Job`='%d', `Faction`='%d', `Prix`='%d' WHERE id=%d",
Vehiculedata_infos[id][v_Model],
ProprioCar,
Vehiculedata_infos[id][v_posX],
Vehiculedata_infos[id][v_posY],
Vehiculedata_infos[id][v_posZ],
Vehiculedata_infos[id][v_posA],
Vehiculedata_infos[id][v_Color1],
Vehiculedata_infos[id][v_Color2],
Vehiculedata_infos[id][v_Type],
Vehiculedata_infos[id][v_mLock],
Vehiculedata_infos[id][v_VirtualWorld],
Vehiculedata_infos[id][v_Job],
Vehiculedata_infos[id][v_Faction],
Vehiculedata_infos[id][v_Prix],
id);
mysql_query(Requete);
return 1;
}