24.05.2015, 10:40
You never passed playerid to mysql_function_query.The OnPlayerLoadVehicles Callback will be called with random playerid(could be 0 , I am not sure).
You don't need another function to call a function and needn't select all vehicles.Just directly fetch the player's vehicles.
Use the same OnPlayerLoadVehicles callback(the one which you have).
You don't need another function to call a function and needn't select all vehicles.Just directly fetch the player's vehicles.
Код:
public OnPlayerConnect(playerid) { static query[128]; mysql_format(mysql, query, sizeof(query), "SELECT * FROM `pvehicles` WHERE `vOwner` = '%s'", name); mysql_function_query(mysql, query, true,"OnPlayerLoadVehicles", "i",playerid); return 1; }