Car Problem
#1

Hey guys,

Am having problems, it seems that once my cars spawn, they don't save the faction ID's, so like when it spawns, sets it to the factions ID so that it restricts people from entering the car but it doesn't seem to save the ID through the vInfo or database, heres one of the codes for it:

pawn Код:
stock CreateSASDVehicle(playerid, model)
{
    new Query[300], v;

    v = CreateVehicle(model, 171.8950, -14.6031, 1.5781, 268.1325, 55, 1, 10000000000000, 1);

    vInfo[v][ModelID] = model;
    vInfo[v][posX] = 171.8950;
    vInfo[v][posY] = -14.6031;
    vInfo[v][posZ] = 1.5781;
    vInfo[v][posA] = 268.1325;
    vInfo[v][ColorA] = 55;
    vInfo[v][ColorB] = 0;
    vInfo[v][Faction] = 2;
    vInfo[v][Faction] = 2;
    format(vInfo[v][NrPlate], vInfo[v][NrPlate], "BB-0000");

    format(Query, sizeof(Query), "INSERT INTO `vehicledata` (`ModelID`, `posX`, `posY`, `posZ`, `posA`, `ColorA`, `ColorB`, `Faction`, `Plate`) VALUES (%d, %f, %f, %f, %f, %d, %d, %d, '%s')",
    vInfo[v][ModelID],
    vInfo[v][posX],
    vInfo[v][posY],
    vInfo[v][posZ],
    vInfo[v][posA],
    vInfo[v][ColorA],
    vInfo[v][ColorB],
    vInfo[v][Faction],
    vInfo[v][NrPlate]);
    mysql_query(Query);
    return 1;
}
Reply
#2

Bump, can anyone help me please?
Reply
#3

I didn't quite understand the problem. What exactly happens when a vehicle is spawned?
Reply
#4

When it spawns, it SHOULD set the vehicles faction ID to what ever it is (so in this case SASD is ID 2) and when someone who's not in the SASD, will get kicked out of the vehicle but for some odd reason its not showing showing the vehicles info (which says what department its owned by etc) or kicking them out of the vehicle
Reply
#5

Can you take a screen shot of the 'vehicledata' table ?
Reply
#6

I don't need to, the stuff saves apart from the faction id or car plate, there are the only two things that will not save properly
Reply
#7

If you want people to help you should provide them with the info they need.
Reply
#8

I have given the information you need, and that is, what it is saving and what its not, and like I JUST SAID it doesn't save it in the vInfo which is an enum!
Reply
#9

Did you even look in the DB to check if the faction id saves in the table ?
Reply
#10

Like I said, it doesn't save in the db either...
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)