House car spawning[MYSQL]
#1

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:
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);

                }
            }
        }
    }
Ofcourse i get errors of:
Код:
AVehicleData[playerid][VehicleID][numId]
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!
Reply


Messages In This Thread
House car spawning[MYSQL] - by thimo - 04.07.2013, 11:32
Re: House car spawning[MYSQL] - by thimo - 04.07.2013, 12:11
Re: House car spawning[MYSQL] - by thimo - 04.07.2013, 13:56
Re: House car spawning[MYSQL] - by thimo - 05.07.2013, 05:25
Re: House car spawning[MYSQL] - by SwisherSweet - 05.07.2013, 05:59
Re: House car spawning[MYSQL] - by thimo - 05.07.2013, 08:47

Forum Jump:


Users browsing this thread: 2 Guest(s)