15.07.2011, 07:23
(
Последний раз редактировалось human-product; 15.07.2011 в 11:36.
)
Good evening,
This is the 6 o'clock I'm on the problem, I can not find a solution. I am creating my GameMode, I made the login system, it works ... I am trying to show the vehicles contained in a MySQL table by making a loop that increments the id parameter, which is different to the vehicle (plate, engine off base ...).
Then the server connection is good (it works for the login and test ...), I only have the problem of the loop ... I try with a "For", "While", following the wiki, always the same. I begin to despair ...
This is my code:
I try different stuff, I can not, I really need help!
Thank you in advance of the writers.
PS: Sorry for my English, I am French, I use "******" ...
This is the 6 o'clock I'm on the problem, I can not find a solution. I am creating my GameMode, I made the login system, it works ... I am trying to show the vehicles contained in a MySQL table by making a loop that increments the id parameter, which is different to the vehicle (plate, engine off base ...).
Then the server connection is good (it works for the login and test ...), I only have the problem of the loop ... I try with a "For", "While", following the wiki, always the same. I begin to despair ...
This is my code:
Код:
mysql_query("SELECT * FROM `vehicules`"); mysql_store_result(); mysql_retrieve_row(); new ID[8], Model[16], Pos_x[512], Pos_y[512], Pos_z[512], Pos_a[512], Couleur_1[16], Couleur_2[16], Plaque[512]; new Alarme[8], Proprietaire[1024], Essence[256], Prix[256], Status_de_vente[8]; new vehID[8]; mysql_fetch_field_row(vehID, "id"); ID = vehID; if(mysql_num_rows()) { while(mysql_retrieve_row()) { VehicleInfo[strval(ID)][vID] = strval(ID); mysql_fetch_field_row(Model, "Model"); VehicleInfo[strval(ID)][vModel] = strval(Model); mysql_fetch_field_row(Pos_x, "Pos_x"); VehicleInfo[strval(ID)][vPos_x] = strval(Pos_x); mysql_fetch_field_row(Pos_y, "Pos_y"); VehicleInfo[strval(ID)][vPos_y] = strval(Pos_y); mysql_fetch_field_row(Pos_z, "Pos_z"); VehicleInfo[strval(ID)][vPos_z] = strval(Pos_z); mysql_fetch_field_row(Pos_a, "Pos_a"); VehicleInfo[strval(ID)][vPos_a] = strval(Pos_a); mysql_fetch_field_row(Couleur_1, "Couleur_1"); VehicleInfo[strval(ID)][vCouleur_1] = strval(Couleur_1); mysql_fetch_field_row(Couleur_2, "Couleur_2"); VehicleInfo[strval(ID)][vCouleur_2] = strval(Couleur_2); mysql_fetch_field_row(Plaque, "Plaque"); VehicleInfo[strval(ID)][vPlaque] = strval(Plaque); mysql_fetch_field_row(Alarme, "Alarme"); VehicleInfo[strval(ID)][vAlarme] = strval(Alarme); mysql_fetch_field_row(Proprietaire, "Proprietaire"); VehicleInfo[strval(ID)][vProprietaire] = strval(Proprietaire); mysql_fetch_field_row(Essence, "Essence"); VehicleInfo[strval(ID)][vEssence] = strval(Essence); mysql_fetch_field_row(Prix, "Prix"); VehicleInfo[strval(ID)][vPrix] = strval(Prix); mysql_fetch_field_row(Status_de_vente, "Status_de_vente"); VehicleInfo[strval(ID)][vStatus_de_vente] = strval(Status_de_vente); AddStaticVehicle(VehicleInfo[strval(ID)][vModel], VehicleInfo[strval(ID)][vPos_x], VehicleInfo[strval(ID)][vPos_y], VehicleInfo[strval(ID)][vPos_z], VehicleInfo[strval(ID)][vPos_a], VehicleInfo[strval(ID)][vCouleur_1], VehicleInfo[strval(ID)][vCouleur_2]); SetVehicleNumberPlate(strval(ID), VehicleInfo[strval(ID)][vPlaque]); GetVehicleParamsEx(strval(ID), engine_param, lights_param, alarm_param, doors_param, bonnet_param, boot_param, objective_param); SetVehicleParamsEx(strval(ID), false, lights_param, alarm_param, doors_param, bonnet_param, boot_param, objective_param); ID++; } } mysql_free_result();
Thank you in advance of the writers.
PS: Sorry for my English, I am French, I use "******" ...