MySQL Player Vehicles.
#10

Quote:
Originally Posted by Feli97
Посмотреть сообщение
I've done this 2nd version but it doesn't work too..
Код:
 stock initiatePVehicleSpawns(playerid) {
	new sql[164],result[1024],bool: success = true, vlodded, line[1024];
	GetPlayerName(playerid, pname, sizeof (pname));
 	format(sql, sizeof(sql), "SELECT * FROM playervehicles WHERE vOwner = '%s'", pname);
 	mysql_query(sql);
    mysql_store_result(RegistrationSystemConnection);
    vlodded = mysql_num_rows(RegistrationSystemConnection);
    printf("%d",vlodded);
    for(new i=0; i<mysql_num_rows(RegistrationSystemConnection); i++)
    {
	               	mysql_fetch_row(line);
	               	
  	 				mysql_get_field("vOwner", pVehicleInfo[i][vOwner]);

					mysql_get_field("vModel", result);
					pVehicleInfo[i][vModel] = strval(result);

					mysql_get_field("vX", result);
					pVehicleInfo[i][vVehiclePosition][0] = floatstr(result);

					mysql_get_field("vY", result);
					pVehicleInfo[i][vVehiclePosition][1] = floatstr(result);

					mysql_get_field("vZ", result);
					pVehicleInfo[i][vVehiclePosition][2] = floatstr(result);

					mysql_get_field("vA", result);
					pVehicleInfo[i][vVehicleRotation] = floatstr(result);

					mysql_get_field("vColor1", result);
					pVehicleInfo[i][vColor][0] = strval(result);

					mysql_get_field("vColor2", result);
					pVehicleInfo[i][vColor][1] = strval(result);

					mysql_get_field("vPaintjob", result);
					pVehicleInfo[i][vPaintjob] = strval(result);
					printf("Trovato veicolo %d, Owner %s",i ,pVehicleInfo[i][vOwner]);
					vPuzz[i] = 1;

					systemVariables[vehicleCounts][0]++;
				}
    if(success) printf("[script] %d vehicles loaded.", systemVariables[vehicleCounts][0]);
	mysql_free_result();
	}
Can you post a picture of your MySQL database structure ?
Reply


Messages In This Thread
MySQL Player Vehicles. - by Feli97 - 24.05.2011, 08:17
Re: MySQL Player Vehicles. - by Feli97 - 24.05.2011, 09:48
Re: MySQL Player Vehicles. - by Feli97 - 24.05.2011, 10:47
Re: MySQL Player Vehicles. - by dannyk0ed - 24.05.2011, 10:49
Re: MySQL Player Vehicles. - by Feli97 - 24.05.2011, 11:15
Re: MySQL Player Vehicles. - by Feli97 - 24.05.2011, 17:30
Re: MySQL Player Vehicles. - by Feli97 - 24.05.2011, 17:56
Re: MySQL Player Vehicles. - by GamingTurf - 24.05.2011, 18:13
Re: MySQL Player Vehicles. - by Feli97 - 24.05.2011, 18:15
Re: MySQL Player Vehicles. - by GamingTurf - 24.05.2011, 18:20

Forum Jump:


Users browsing this thread: 1 Guest(s)