02.02.2014, 14:05
I'm posting this for my bro, cause he dont have an acc.
Hey, in my old topic i asked u how to save a car -> worked
but now i want to load it and i got some problems.
How can i load them? And do u have a good mysql tutorial? Cause i dont get it well.
(sry for bad engl. )
Hey, in my old topic i asked u how to save a car -> worked
but now i want to load it and i got some problems.
Код:
stock LoadPlayerCars() { new i; new string[6]; for(; i<= //what here?; i++) { format(string, sizeof(string), "%d", i); format(Playercar[i][owner], MAX_PLAYER_NAME, mysql_GetString("cars", "owner", "id", string)); Playercar[i][spawnx] = mysql_GetFloat("cars", "spawnx", "id", string); Playercar[i][spawny] = mysql_GetFloat("cars", "spawny", "id", string); Playercar[i][spawnz] = mysql_GetFloat("cars", "spawnz", "id", string); Playercar[i][spawnr] = mysql_GetFloat("cars", "spawnr", "id", string); Playercar[i][c1] = mysql_GetInt("cars", "c1", "id", string); Playercar[i][c2] = mysql_GetInt("cars", "c2", "id", string); format(Playercar[i][plate], 20, "%s", mysql_GetString("cars", "plate", "id", string)); Playercar[i][modelid] = mysql_GetInt("Cars", "model", "id", string); Playercar[i][price] = mysql_GetInt("Cars", "price", "id", string); Playercar[i][car] = AddStaticVehicleEx(Playercar[i][modelid], Playercar[i][spawnx], Playercar[i][spawny], Playercar[i][spawnz], Playercar[i][spawnr], Playercar[i][c1], Playercar[i][c2], -1); printf("i = %d, owner = %s, x = %f, y = %f, z = %f, r = %f, c1 = %d, c2 = %d, plate = %s, model = %d, price = %d, car = %d", i, Playercar[i][modelid], Playercar[i][spawnx], Playercar[i][spawny], Playercar[i][spawnz], Playercar[i][spawnr], Playercar[i][c1], Playercar[i][c2], Playercar[i][plate], Playercar[i][modelid], Playercar[i][price], Playercar[i][car]);
(sry for bad engl. )