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

pawn Код:
stock loadfactionvehicles(iFaction)
{
    new Query[700], vehicleID;
    format(Query, sizeof(Query), "SELECT * FROM `vehicleinfo` WHERE `vfaction` > 0");
    mysql_query(Query);
    mysql_store_result();
    while(mysql_retrieve_row())
    {
        mysql_fetch_row(Query);
        sscanf(Query, "i", vehicleID); // This is assuming that ID is the first column
        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[vehicleID]); //NEEDS CHANING TO SUIT VVAR
        VVar[vehicleID][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)