Spawning Private Vehicles[MySQL]
#9

Bump.

I've been debugging the code aswell as working with SSCANF.

PHP Code:
stock LoadPlayerVehicles(playerid)
{
    new 
query[400];
    
format(querysizeof(query), "SELECT * FROM `playervehicles` WHERE `OwnerName` = '%s'"PlayerName(playerid));
    
mysql_query(query);
    
mysql_store_result();
    new 
i;
    while(
MAX_PLAYER_OWNED_CARS && mysql_retrieve_row())
    {
        
mysql_fetch_row_format(query);
        
sscanf(query"e<p<|>s[25]dffffdddddddddddddddddddddddddddddddddddd{d}>"PlayerOwnedVehicles[playerid][i]);
        
PlayerOwnedVehicles[playerid][i][pCarID] = CreateVehicle(PlayerOwnedVehicles[playerid][i][pCarModel], PlayerOwnedVehicles[playerid][i][pCarX], PlayerOwnedVehicles[playerid][i][pCarY], PlayerOwnedVehicles[playerid][i][pCarZ], PlayerOwnedVehicles[playerid][i][pCarRot], PlayerOwnedVehicles[playerid][i][pCarColor1], PlayerOwnedVehicles[playerid][i][pCarColor2], -1);
        
AddVehicleMods(playeridi);
        
i++;
    }
    
mysql_free_result();
    return 
true;

This what I have and it keeps telling me that I have a buffer overflow when I add a size to the S variable.

For the post above the S variable signifies the vehicle owners name and the D at the end of the SSCANF is the carid that comes out once the vehicle has been spawned, the owners name is in the database but the carid isn't as it's dynamic, though it's in the enum. I would really love to see this fixed and behind me. Thankyou all for the support so far. Aswell as the vehicles aswell are still not spawning.
Reply


Messages In This Thread
Spawning Private Vehicles[MySQL] - Vehicle Not Spawning. - by Peach - 21.12.2012, 16:21
Re: Spawning Private Vehicles[MySQL] - by Peach - 22.12.2012, 16:45
Re: Spawning Private Vehicles[MySQL] - by Faisal_khan - 22.12.2012, 16:51
Re: Spawning Private Vehicles[MySQL] - by Peach - 22.12.2012, 16:52
Re: Spawning Private Vehicles[MySQL] - by ReneG - 22.12.2012, 17:08
Re: Spawning Private Vehicles[MySQL] - by Peach - 22.12.2012, 17:50
Re: Spawning Private Vehicles[MySQL] - by ReneG - 22.12.2012, 17:57
Re: Spawning Private Vehicles[MySQL] - by Peach - 22.12.2012, 18:05
Re: Spawning Private Vehicles[MySQL] - by Peach - 23.12.2012, 17:58
Re: Spawning Private Vehicles[MySQL] - by ReneG - 24.12.2012, 01:23
Re: Spawning Private Vehicles[MySQL] - by Peach - 24.12.2012, 08:56
Re: Spawning Private Vehicles[MySQL] - by ReneG - 24.12.2012, 20:28
Re: Spawning Private Vehicles[MySQL] - by Peach - 24.12.2012, 20:42
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 24.12.2012, 23:56
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 08:30
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 25.12.2012, 10:17
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 11:18
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 25.12.2012, 12:00
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 13:29
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 25.12.2012, 13:46
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 14:59
Re: Spawning Private Vehicles[MySQL] - by ReneG - 25.12.2012, 16:30
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 16:32
Re: Spawning Private Vehicles[MySQL] - by ReneG - 25.12.2012, 16:41
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 16:43
Re: Spawning Private Vehicles[MySQL] - by ReneG - 25.12.2012, 16:57
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 17:06
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 25.12.2012, 18:26
Re: Spawning Private Vehicles[MySQL] - by Peach - 25.12.2012, 19:36
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 25.12.2012, 20:51
Re: Spawning Private Vehicles[MySQL] - by Peach - 27.12.2012, 18:33
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 27.12.2012, 19:43
Re: Spawning Private Vehicles[MySQL] - by Peach - 27.12.2012, 20:42
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 27.12.2012, 21:19
Re: Spawning Private Vehicles[MySQL] - by Peach - 28.12.2012, 09:51
Re: Spawning Private Vehicles[MySQL] - by Peach - 30.12.2012, 14:43
Re: Spawning Private Vehicles[MySQL] - by BlackBank - 31.12.2012, 14:48
Re: Spawning Private Vehicles[MySQL] - by Peach - 01.01.2013, 16:07

Forum Jump:


Users browsing this thread: 5 Guest(s)