|
Vehicle1 Vehicle2 Vehicle3 Vehicle4 |
|
House1 House2 .. |
new id = PlayerInfo[playerid][Vehicle1]; VehicleInfo[id][Model]
//So here u check if player has a vehicle and spawn it, something like this?
if(PlayerInfo[pCar1] == Whatever)
{
CreateVehicle...
}
// So here u again check if player has a vehicle
if(PlayerInfo[pCar1] == Whatever)
{
DestroyVehicle...
}
#include <a_samp>
#define MAX_VEHICLES 1000 //The limit is 100 now (you can not create something unlimited you can just edit the limit to 100000 or something like that)
public OnPlayerConnect(playerid)
{
for(new i = 0; i <= MAX_VEHICLES; i++) //It is the loop, so now your ID starts from 0 to your MAX_VEHICLES number which is 1000 for now
{
if(strcmp(your parameters))
{
//Before creating the vehicle you have to load all the stuff from your database HERE<<<<
CreateVehicle(VehicleInfo[i][Model], VehicleInfo[i][X], VehicleInfo[i][Y], VehicleInfo[i][Z], VehicleInfo[i][Rotation], VehicleInfo[i][Color1], VehicleInfo[i][Color2], VehicleInfo[i][rDelay]);
}
}
}
enum PlayerVehicleData
{
CarDatabaseID[MAX_PLAYER_VEHICLES],
CarID[MAX_PLAYER_VEHICLES],
CarModel[MAX_PLAYER_VEHICLES],
Float:CarX[MAX_PLAYER_VEHICLES],
Float:CarY[MAX_PLAYER_VEHICLES],
Float:CarZ[MAX_PLAYER_VEHICLES],
Float:CarA[MAX_PLAYER_VEHICLES],
CarColour[MAX_PLAYER_VEHICLES],
CarColour2[MAX_PLAYER_VEHICLES],
CarVW[MAX_PLAYER_VEHICLES],
CarInt[MAX_PLAYER_VEHICLES],
CarFuel[MAX_PLAYER_VEHICLES],
CarMod0[MAX_PLAYER_VEHICLES],
CarMod1[MAX_PLAYER_VEHICLES],
CarMod2[MAX_PLAYER_VEHICLES],
CarMod3[MAX_PLAYER_VEHICLES],
CarMod4[MAX_PLAYER_VEHICLES],
CarMod5[MAX_PLAYER_VEHICLES],
CarMod6[MAX_PLAYER_VEHICLES],
CarMod7[MAX_PLAYER_VEHICLES],
CarMod8[MAX_PLAYER_VEHICLES],
CarMod9[MAX_PLAYER_VEHICLES],
CarMod10[MAX_PLAYER_VEHICLES],
CarMod11[MAX_PLAYER_VEHICLES],
CarMod12[MAX_PLAYER_VEHICLES],
CarMod13[MAX_PLAYER_VEHICLES],
CarPaintJob[MAX_PLAYER_VEHICLES],
CarPlate1[8],
CarPlate2[8],
CarPlate3[8],
CarPlate4[8],
CarPlate5[8]
}
|
EDIT: If u wanted players to have unlimited number of vehicles that's an another story ( Like they can purchase 500 cars or something like that ) |