04.07.2013, 11:32
I need some help with my house car spawning. My brain is dieing because of it lol i cant seem to find out how to make it work. I got this under OnPlayerConnect:
Ofcourse i get errors of:
But i dont know how to fix it and make it load. Also how to save the vehicle ids to a variable. Hopefully someone can help me!
pawn Код:
GetPlayerName(playerid, name, sizeof(name));
new xPosVeh[60], yPosVeh[60], zPosVeh[60], ModelID[10], Rotation[20];
format(str, sizeof(str), "SELECT `HouseID` FROM `Houses` WHERE `Owner`='%s'", name);
mysql_query(str);
mysql_get_field("HouseID", str);
mysql_free_result();
if(!sscanf(str, "d", integer))
{
if(integer != 0) //Player has a house...
{
format(str, sizeof(str), "SELECT * FROM `Vehicles` WHERE `HouseID`= '%d'", integer);
mysql_query(str);
if(mysql_num_rows() != 0)
{
while(mysql_num_rows()) //Loop xD
{
AVehicle[playerid][vehicleID][numId] = Vehicle_Create(AVehicle[playerid][vehicleID][CarModel], AVehicle[playerid][vehicleID][CarPos_X], AVehicle[playerid][vehicleID][CarPos_Y], AVehicle[playerid][vehicleID][CarPos_Z],
AVehicle[playerid][vehicleID][CarPos_Rot], AVehicle[playerid][vehicleID][Color1], AVehicle[playerid][vehicleID][Color2], 300);
}
}
}
}
Код:
AVehicleData[playerid][VehicleID][numId]