• 17 Avril 2025, 10:02:17


Auteur Sujet: Problème CacheVeh chargement de véhicule  (Lu 871 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne DarkZeroX

  • *
  • Nouveau
  • Messages: 15
    • Voir le profil
Problème CacheVeh chargement de véhicule
« le: 03 Novembre 2013, 13:39:56 »
Salut, je sais que je poste pas mal de demande d'aide mais le forum est fait pour ça non?^^

Alors voilà, j'ai fais un système de 'CacheVeh' tout les véhicules qui non aucun rapport avec le système de véhicule auront 'CacheVeh[IDVEH] = -1' et tout les autres il auront en IDVEH bah l'id du véhicule dite par le serveur et après en = il auront de 0 au nombre de véhicule genre

CacheVeh[12] = 0;
CacheVeh[13] = 1;
CacheVeh[14] = 2;
CacheVeh[15] = 3;


Mais malheureusement ça marche mais après quand je fais 'V_Info[cacheVeh[CarLoad]][V_Moteur]' ça fonctionne pas regarder


cacheVeh[C] = CarLoad;
printf("CacheVeh[C] = %d | VLoad = %d | Proprio: %s | Moteur: %d",cacheVeh[C],VLoad,V_Info[i][V_Proprio],V_Info[i][V_Moteur]);
printf("Moteur avec CacheVeh : %d, Proprio: %s",V_Info[cacheVeh[CarLoad]][V_Moteur],V_Info[cacheVeh[CarLoad]][V_Proprio]);


ça fonctionne que pour le premier véhicule après plus rien voici le code.

public Vehicule_Load()
{
new fichier[128];
new C,Count,CarLoad;
        for(new i; i < MAX_VEHICLES; i++)
        {
            if(IsValidVehicle(i)) Count++;
        }
        CarLoad = Count;
for(new i = 0; i < MAX_VEHICULES; i++)
{
format(fichier, 128, "_veh/%d.ini", i);
if(fexist(fichier))
{
V_Info[i][V_SpawnX] = dini_Float(fichier, "SpawnX");
V_Info[i][V_SpawnY] = dini_Float(fichier, "SpawnY");
V_Info[i][V_SpawnZ] = dini_Float(fichier, "SpawnZ");
V_Info[i][V_SpawnA] = dini_Float(fichier, "SpawnA");
V_Info[i][V_Model]      = dini_Int(fichier, "Model");
V_Info[i][V_Couleur1]      = dini_Int(fichier, "Couleur1");
V_Info[i][V_Couleur2]      = dini_Int(fichier, "Couleur2");
V_Info[i][V_Type]      = dini_Int(fichier, "Type");
V_Info[i][V_Prix]      = dini_Int(fichier, "Prix");
V_Info[i][V_Essence]      = dini_Int(fichier, "Essence");
V_Info[i][V_Moteur]      = dini_Int(fichier, "Moteur");
format(V_Info[i][V_Plaque], MAX_PLAYER_NAME, dini_Get(fichier, "Plaque"));
format(V_Info[i][V_Proprio], MAX_PLAYER_NAME, dini_Get(fichier, "Proprio"));
V_Info[i][V_Huile] = dini_Float(fichier, "Huile");
V_Info[i][V_Batterie] = dini_Float(fichier, "Batterie");
V_Info[i][V_Phares] = dini_Int(fichier, "Phares");
V_Info[i][V_Fourriere] = dini_Int(fichier, "Fourriere");
V_Info[i][V_Alarmes] = dini_Int(fichier, "Alarmes");
V_Info[i][V_Portes] = dini_Int(fichier, "Portes");
V_Info[i][V_Etat] = dini_Float(fichier, "Etat");
V_Info[i][V_ControleTechnique] = dini_Int(fichier, "ControleTechnique");
V_Info[i][V_Pneu] = dini_Float(fichier, "Pneu");
V_Info[i][V_Kilometrage] = dini_Float(fichier, "Kilometrage");
V_Info[i][V_LocationTemps] = dini_Int(fichier, "LocationTemps");
format(V_Info[i][V_Location], MAX_PLAYER_NAME, dini_Get(fichier, "Location"));
C = CreateVehicle(V_Info[i][V_Model], V_Info[i][V_SpawnX],V_Info[i][V_SpawnY],V_Info[i][V_SpawnZ],V_Info[i][V_SpawnA], V_Info[i][V_Couleur1], V_Info[i][V_Couleur2], -1);
                        SetVehicleParamsDef(i, V_Info[i][V_Moteur], V_Info[i][V_Phares], V_Info[i][V_Alarmes],V_Info[i][V_Portes]);
                        SetVehicleHealth(i,V_Info[i][V_Etat]);
                        cacheVeh[C] = CarLoad;
        printf("CacheVeh[C] = %d | VLoad = %d | Proprio: %s | Moteur: %d",cacheVeh[C],VLoad,V_Info[i][V_Proprio],V_Info[i][V_Moteur]);
        printf("Moteur avec CacheVeh : %d, Proprio: %s",V_Info[cacheVeh[CarLoad]][V_Moteur],V_Info[cacheVeh[CarLoad]][V_Proprio]);
VLoad++;
CarLoad++;
   }
    }

    return 1;
}


[12:48:24] CacheVeh[C] = 14 | VLoad = 0 | Proprio: Max_Anderson | Moteur: 1
[12:48:24] Moteur avec CacheVeh : 1, Proprio: Max_Anderson

[12:48:24] CacheVeh[C] = 15 | VLoad = 1 | Proprio: Max_Anderson | Moteur: 1
[12:48:24] Moteur avec CacheVeh : 0, Proprio:

[12:48:24] CacheVeh[C] = 16 | VLoad = 2 | Proprio: Aucun | Moteur: 0
[12:48:24] Moteur avec CacheVeh : 0, Proprio:

[12:48:24] CacheVeh[C] = 17 | VLoad = 3 | Proprio: Aucun | Moteur: 0
[12:48:24] Moteur avec CacheVeh : 0, Proprio:

[12:48:24] CacheVeh[C] = 18 | VLoad = 4 | Proprio: Max_Anderson | Moteur: 1
[12:48:24] Moteur avec CacheVeh : 0, Proprio:

Merci^^