04.01.2015, 13:17
Title says it all. The gamemode I'm developing has a Masteraccount and characters integrated with it. So, Yeah well. I need multiple Vehicles Per Character. I'll start step by step.
The define having the Maximum car Slots Per character.
The Enumerator having all the vehicles within Characters.
So, After the Player has Chosen a character and Spawned. The System is supposed to spawn All The 3 Vehicles owned by him. Using this.
under SpawnPlayervehicle(playerid), I'm spawning the vehicles loaded at Loadvehicle. i.e Above ^
The define having the Maximum car Slots Per character.
pawn Код:
#define MAX_CARSLOTS 3
pawn Код:
enum OwnedCarSlot
{
id,
bool:loaded
}
new OwnedVehicle[MAX_PLAYERS][MAX_CARSLOTS][OwnedCarSlot];
So, After the Player has Chosen a character and Spawned. The System is supposed to spawn All The 3 Vehicles owned by him. Using this.
pawn Код:
mysql_format(handle, query, sizeof(query), "SELECT * FROM `Vehicles` WHERE `vOwner`='%e'", name);
mysql_tquery(handle, query, "SpawnPlayerVehicle", "i", playerid);
pawn Код:
new rows, fields;
cache_get_data(rows, fields);
if(rows) //If the player was found when LoadVehicle() was called
{
for(new i; i != MAX_CARSLOTS-1; i++) //-1 because 0 ,1, 2;
{
// Spawn the vehicle here.....
// What am I supposed to do here? It creates the vehicles, but I need help assigning them to the enum I mentioned above.
//After getting the cache,
VehicleInfo[playerid][vActualID] = CreateVehicle(VehicleInfo[playerid][vModel], VehicleInfo[playerid][vX], VehicleInfo[playerid][vY], VehicleInfo[playerid][vZ], VehicleInfo[playerid][vA], VehicleInfo[playerid][vColor1], VehicleInfo[playerid][vColor2], -1);