On INIT twice, but on cmd once !
#1

pawn Код:
Loop(h, MAX_VEHICLES)
    {
          format(file,sizeof(file),local,h);
          if(fexist(file))
          {
               INI_Open(file);
               INI_ReadString(Vehicle[h][Owner], "Owner", MAX_PLAYER_NAME);
               INI_ReadString(Vehicle[h][Plate], "Plate", 32);
               Vehicle[h][Model] = INI_ReadInt("Model");
               Vehicle[h][Color1] = INI_ReadInt("Color1");
               Vehicle[h][Color2] = INI_ReadInt("Color2");
               Vehicle[h][ID] = INI_ReadInt("ID");
               Vehicle[h][x] = INI_ReadFloat("x");
               Vehicle[h][y] = INI_ReadInt("y");
               Vehicle[h][z] = INI_ReadInt("z");
               CreateVehicle(Vehicle[h][Model],Vehicle[h][x],Vehicle[h][y],Vehicle[h][z],Vehicle[h][a],Vehicle[h][Color1],Vehicle[h][Color2],500000);
               Owned[h] = 1;
               SetVehicleNumberPlate(h,Vehicle[h][Plate]);
               hcount++;
          }
           
    }
    printf(" * Amount of loaded vehicles: %d * ",hcount);
I put for show all owners names on the printf, and detected twice my name, as I have two cars. But on my command, it just detects there were found a single car with my name, as I made a count and put for each time it finds my name:
pawn Код:
for(new v; v < MAX_VEHICLES; v++)
    {
        if(!strcmp(Vehicle[v][Owner],GetMyName(playerid),true))
        {
            contagem++;
            printf("%i",contagem); // Says just founds 1 vehicles with my owner name
            format(string,sizeof(string),""#red"Name: %s | Model: %d | ID: %d\n",VehicleNames[Vehicle[v][Model]-400],Vehicle[v][Model],Vehicle[v][ID]);
            return ShowPlayerDialog(playerid,ME_DIALOG,DIALOG_STYLE_MSGBOX,""#green"Your vehicles",string,"Ok","");
           
        }
    }
What may be wrong?
Reply


Messages In This Thread
On INIT twice, but on cmd once ! - by blackwave - 01.03.2011, 20:57
Re: On INIT twice, but on cmd once ! - by JaTochNietDan - 01.03.2011, 21:02
Re: On INIT twice, but on cmd once ! - by blackwave - 01.03.2011, 21:06
Re: On INIT twice, but on cmd once ! - by JaTochNietDan - 01.03.2011, 21:07
Re: On INIT twice, but on cmd once ! - by blackwave - 01.03.2011, 21:15
Re: On INIT twice, but on cmd once ! - by blackwave - 02.03.2011, 20:09

Forum Jump:


Users browsing this thread: 1 Guest(s)