Getting the ID of the vehicle that has just been spawned.
#1

I am using MySQL to store vehicle data and using enum's to store the data in the script as well as the database (Just like player info), but I'm not too sure how to actually store the vehicle data into the enums, I know that I would use the vehicle's ID that has just been spawned but I'm not too sure how to actually retrieve that information without actually creating an array and saving the info to that entry in the array.

Here's the "Hypothetical" code that I have created using the previous faction and player info.
pawn Код:
stock loadfactionvehicles(iFaction)
{
    new Query[700];
    format(Query, sizeof(Query), "SELECT * FROM `vehicleinfo` WHERE `vfaction` > 0");
    mysql_query(Query);
    mysql_store_result();
    if (mysql_num_rows())
    {
        mysql_fetch_row_format(Query, "|");
        //sscanf(Query, "p<|>e<is[32]is[32]s[32]s[32]s[32]s[32]s[32]s[32]s[32]s[32]s[32]ifffffffffffffff>", VVar[*THIS IS WHAT I NEED*]); //NEEDS CHANING TO SUIT VVAR
        VVar[*THIS IS WHAT I NEED*][vfaction] = iFaction;
    }
    return 1;
}
Reply


Messages In This Thread
Getting the ID of the vehicle that has just been spawned. - by vIBIENNYx - 02.10.2012, 13:37
Re: Getting the ID of the vehicle that has just been spawned. - by SuperViper - 02.10.2012, 14:29
Re: Getting the ID of the vehicle that has just been spawned. - by vIBIENNYx - 02.10.2012, 14:59

Forum Jump:


Users browsing this thread: 1 Guest(s)