06.07.2013, 20:29
(
Последний раз редактировалось thimo; 06.07.2013 в 21:18.
)
When i tag it with /* */ and run it without the script it works fine.. :S
Okay i tagged out all get fields in the loop.. Now it still crashes... That means its something with the query not being excecuted properly D: How to get it fixed?
This still crashes me:
Okay i tagged out all get fields in the loop.. Now it still crashes... That means its something with the query not being excecuted properly D: How to get it fixed?
This still crashes me:
pawn Код:
// Setup local variables
new cModel[15], cx[15], cy[15], cz[15], crot[15], Col1[15], Col2[15], string[128];
GetPlayerName(playerid, name, sizeof(name));
// new Float:cx, Float:cy, Float:cz, Float:crot, cModel;
format(string, sizeof(string), "SELECT `HouseID` FROM `Houses` WHERE `Houseowner`='%s'", name);
mysql_query(string); //Send the query to the SQLite system integrated in SA:MP
mysql_get_field("HouseID", string); //Gets the first field of the row returned (HouseID)
mysql_free_result();
if(!sscanf(string, "d", integer))
{
if(integer != 0) //Player has a house...
{
format(string, sizeof(string), "SELECT * FROM `Vehicles` WHERE `HouseID`= '%d'", integer);
mysql_query(string);
if(mysql_num_rows() != 0)
{
while(mysql_num_rows()) //Loop xD
{
/* //Do what you want with the vehicle :P
//Use db_get_field or db_get_field_assoc
//Remember to store the vehicle IDs in a variable so you can delete them in OnPlayerDisconnect
mysql_get_field("Model", cModel);
mysql_get_field("X", cx);
mysql_get_field("Y", cy);
mysql_get_field("Z", cz);
mysql_get_field("Rot", crot);
mysql_get_field("Color1", Col1);
mysql_get_field("Color2", Col2);
new hId = strval(str);
House_AddVehicle(hId, strval(cModel), floatstr(cx), floatstr(cy), floatstr(cz), floatstr(crot), strval(Col1), strval(Col2));*/
}
print("Does work");
}
}
}