[ HELP ] Can't Load Maps / Gates / Parkour etc
#1

When i connect my server i mean when i start my server so it don't load" Maps / Gates / Parkours / Races / Pickups "Which are located in Scriptfiles.
Anyone can help me?

See the pics below :

Then


Codes
pawn Код:
CreateCwWinTD();
    LoadGates();
    LoadCreatedRaces();
    LoadCreatedParkours();
    LoadPickups();

stock GatePath(gateid)
{
  new gatefile[64];
  format(gatefile, sizeof(gatefile), "Gates/GateID%d.ini", gateid);
  return gatefile;
}
Reply
#2

Show us the LoadGates function.
Reply
#3

Here it is
pawn Код:
stock LoadGates()
{
  for(new iD=0;iD<MAX_GATES;iD++)
  {
    if(fexist(GatePath(iD)))
    {
        INI_ParseFile(GatePath(iD), "LoadGate_gatedata", .bExtra = true, .extra = iD);
        GateInfo[iD][ObjectID] = CreateDynamicObject(GateInfo[iD][gModel],GateInfo[iD][gPos][0],GateInfo[iD][gPos][1],GateInfo[iD][gPos][2],GateInfo[iD][gPos][3],GateInfo[iD][gPos][4],GateInfo[iD][gPos][5]);
        GateInfo[iD][gKeypad1] = CreateDynamicObject(19273,GateInfo[iD][k1][0],GateInfo[iD][k1][1],GateInfo[iD][k1][2],0,0,GateInfo[iD][k1][3]);
        GateInfo[iD][gKeypad2] = CreateDynamicObject(19273,GateInfo[iD][k2][0],GateInfo[iD][k2][1],GateInfo[iD][k2][2],0,0,GateInfo[iD][k2][3]);

        GateInfo[iD][IsOpened]=0;
        if(GateInfo[iD][g_type] == 1) GateInfo[iD][g_range] = CreateDynamicSphere(GateInfo[iD][gPos][0],GateInfo[iD][gPos][1],GateInfo[iD][gPos][2], 5.00,0);

        if(GateInfo[iD][gModel] == 5837 || GateInfo[iD][gModel] == 18755)
        {
            GateInfo[iD][gKeypad3] = CreateDynamicObject(19273,GateInfo[iD][ok3][0],GateInfo[iD][ok3][1],GateInfo[iD][ok3][2],GateInfo[iD][ok3][3],GateInfo[iD][ok3][4],GateInfo[iD][ok3][5]);

        }
    }
    else
    {
          GateInfo[iD][ObjectID]=INVALID_OBJECT_ID;
          GateInfo[iD][gKeypad1]=INVALID_OBJECT_ID;
          GateInfo[iD][gKeypad2]=INVALID_OBJECT_ID;
          GateInfo[iD][gKeypad3]=INVALID_OBJECT_ID;
    }
  }
}
Reply
#4

And this is all thing which needs to load when server starts
pawn Код:
stock LoadCreatedRaces()
{
  for(new r=0;r<MAX_RACES;r++)
  {
    if(fexist(RacePath(r)))
    {
      INI_ParseFile(RacePath(r), "LoadRace_%s", .bExtra = true, .extra = r);
    }
  }
}
stock LoadCreatedParkours()
{
  for(new r=0;r<MAX_POURS;r++)
  {
    if(fexist(PourPath(r)))
    {
      INI_ParseFile(PourPath(r), "LoadPOur_%s", .bExtra = true, .extra = r);
    }
  }
}


forward LoadPOur_POUR(r,name[],value[]);
public LoadPOur_POUR(r,name[],value[])
{
      INI_String("Name",ParkOurInfo[r][PourName],50);
      INI_Int("CPcount",ParkOurInfo[r][CPcount]);
      for(new x=0; x<12; x++)
      {
          new str[50];
          format(str,sizeof(str),"SP%dX",x);
          INI_Float(str,ParkOurInfo[r][SpawnsX][x]);
          format(str,sizeof(str),"SP%dY",x);
          INI_Float(str,ParkOurInfo[r][SpawnsY][x]);
          format(str,sizeof(str),"SP%dZ",x);
          INI_Float(str,ParkOurInfo[r][SpawnsZ][x]);
          format(str,sizeof(str),"SP%dA",x);
          INI_Float(str,ParkOurInfo[r][SpawnsA][x]);
      }
      for(new x=0; x<50; x++)
      {
          new str[50];
          format(str,sizeof(str),"CP%dX",x);
          INI_Float(str,ParkOurCPS[r][x][CPposX]);
          format(str,sizeof(str),"CP%dY",x);
          INI_Float(str,ParkOurCPS[r][x][CPposY]);
          format(str,sizeof(str),"CP%dZ",x);
          INI_Float(str,ParkOurCPS[r][x][CPposZ]);
          format(str,sizeof(str),"CP%dCar",x);
          INI_Int(str,ParkOurCPS[r][x][CPCar]);
      }
      return 0;
}


forward LoadRace_RaceInfo(r,name[],value[]);
public LoadRace_RaceInfo(r,name[],value[])
{
      INI_Float("StartX",RaceInfo[r][StartCP][0]);
      INI_Float("StartY",RaceInfo[r][StartCP][1]);
      INI_Float("StartZ",RaceInfo[r][StartCP][2]);
      INI_Float("SpawnpX",RaceInfo[r][Spawnp][0]);
      INI_Float("SpawnpY",RaceInfo[r][Spawnp][1]);
      INI_Float("SpawnpZ",RaceInfo[r][Spawnp][2]);
      INI_Float("SpawnpA",RaceInfo[r][Spawnp][3]);
      INI_Int("CPCount",RaceInfo[r][RaceCpCount]);
      INI_String("Creator",RaceInfo[r][Creator],30);

      new strvar[24];
      for(new x=0; x<50; x++)
      {
            format(strvar,sizeof(strvar),"X_CheckPoint%d",x);
            INI_Float(strvar,RaceCPs[r][x][0]);
            format(strvar,sizeof(strvar),"Y_CheckPoint%d",x);
            INI_Float(strvar,RaceCPs[r][x][1]);
            format(strvar,sizeof(strvar),"Z_CheckPoint%d",x);
            INI_Float(strvar,RaceCPs[r][x][2]);
      }
      return 0;
}
stock GetFreeRaceID()
{
     new Q;
     for(new x=0; x<MAX_RACES; x++)
     {
          if(RaceInfo[x][RaceCpCount] == 0)
          {
                Q=x;
                break;
          }
     }
     return Q;
}
stock RacePath(raceid)
{
       new pathh[128];
       format(pathh,sizeof(pathh),"/CreatedRaces/%d.ini",raceid);
       return pathh;
}

stock LoadPickups()
{
  for(new g=0;g<MAX_C_PICKUPS;g++)
  {
    if(fexist(PickupPath(g)))
    {
      INI_ParseFile(PickupPath(g), "LoadPickup_lol", .bExtra = true, .extra = g);
      if(wPickup[g][Model_] == 1239 || wPickup[g][Model_] == 1242 || wPickup[g][Model_] == 1240)
      {
         wWPickup[g]=CreateDynamicPickup(wPickup[g][Model_],wPickup[g][Spawn],wPickup[g][WPos][0],wPickup[g][WPos][1],wPickup[g][WPos][2],wPickup[g][Wworld]);
      }
      if(wPickup[g][Model_] >= 0 && wPickup[g][Model_] <= 50)
      {
          wWPickup[g]=CreateDynamicPickup(GetWeaponModel(wPickup[g][Model_]),2,wPickup[g][WPos][0],wPickup[g][WPos][1],wPickup[g][WPos][2],wPickup[g][Wworld]);
      }
    }
  }
}

forward LoadPickup_lol(g,name[],value[]);
public LoadPickup_lol(g,name[],value[])
{
    INI_Float("WPos1",wPickup[g][WPos][0]);
    INI_Float("WPos2",wPickup[g][WPos][1]);
    INI_Float("WPos3",wPickup[g][WPos][2]);
    INI_Int("world",wPickup[g][Wworld]);
    INI_Int("Model",wPickup[g][Model_]);
    INI_Int("Spawn",wPickup[g][Spawn]);
    return 0;
}
stock GetFreePickupID()
{
    new ai=-255;
    for(new k=0; k<MAX_C_PICKUPS; k++)
    {
       if(wPickup[k][Model_] == 0)
       {
            ai=k;
            break;
       }
    }
    return ai;
}
stock PickupPath(gateid)
{
  new gatefile[64];
  format(gatefile, sizeof(gatefile), "Pickups/PickupID%d.ini", gateid);
  return gatefile;

}
forward LoadGate_gatedata(iD,name[],value[]);
public LoadGate_gatedata(iD,name[],value[])
{
    INI_Int("ModelID",  GateInfo[iD][gModel]);
    INI_Float("gPos1",  GateInfo[iD][gPos][0]);
    INI_Float("gPos2",  GateInfo[iD][gPos][1]);
    INI_Float("gPos3",  GateInfo[iD][gPos][2]);
    INI_Float("gPos4",  GateInfo[iD][gPos][3]);
    INI_Float("gPos5",  GateInfo[iD][gPos][4]);
    INI_Float("gPos6",  GateInfo[iD][gPos][5]);

    INI_Float("gOpenPos1",  GateInfo[iD][gmovedPos][0]);
    INI_Float("gOpenPos2",  GateInfo[iD][gmovedPos][1]);
    INI_Float("gOpenPos3",  GateInfo[iD][gmovedPos][2]);
    INI_Float("gOpenPos4",  GateInfo[iD][gmovedPos][3]);
    INI_Float("gOpenPos5",  GateInfo[iD][gmovedPos][4]);
    INI_Float("gOpenPos6",  GateInfo[iD][gmovedPos][5]);

    INI_Float("X_Keypad1",  GateInfo[iD][k1][0]);
    INI_Float("Y_Keypad1",  GateInfo[iD][k1][1]);
    INI_Float("Z_Keypad1",  GateInfo[iD][k1][2]);
    INI_Float("R_Keypad1",  GateInfo[iD][k1][3]);

    INI_Float("X_Keypad2",  GateInfo[iD][k2][0]);
    INI_Float("Y_Keypad2",  GateInfo[iD][k2][1]);
    INI_Float("Z_Keypad2",  GateInfo[iD][k2][2]);
    INI_Float("R_Keypad2",  GateInfo[iD][k2][3]);

    INI_Float("X_Keypad3",  GateInfo[iD][k3][0]);
    INI_Float("Y_Keypad3",  GateInfo[iD][k3][1]);
    INI_Float("Z_Keypad3",  GateInfo[iD][k3][2]);
    INI_Float("RX_Keypad3",  GateInfo[iD][k3][3]);
    INI_Float("RY_Keypad3",  GateInfo[iD][k3][4]);
    INI_Float("RZ_Keypad3",  GateInfo[iD][k3][5]);

    INI_Float("OX_Keypad3",  GateInfo[iD][ok3][0]);
    INI_Float("OY_Keypad3",  GateInfo[iD][ok3][1]);
    INI_Float("OZ_Keypad3",  GateInfo[iD][ok3][2]);
    INI_Float("ORX_Keypad3",  GateInfo[iD][ok3][3]);
    INI_Float("ORY_Keypad3",  GateInfo[iD][ok3][4]);
    INI_Float("ORZ_Keypad3",  GateInfo[iD][ok3][5]);

    INI_Float("Speed", GateInfo[iD][gSpeed]);
    INI_Int("Type", GateInfo[iD][g_type]);
    INI_Int("HideObj",GateInfo[iD][HideObj]);

    for(new x=1;x<11;x++)
    {
          new str[10];
          format(str,sizeof(str),"House%d",x);
          INI_Int(str, GateInfo[iD][Houses][x-1]);
    }
    return 0;
}
Reply
#5

Are you sure that "INI_ParseFile(GatePath(iD), "LoadGate_gatedata", .bExtra = true, .extra = iD);" it does load them correctly? Try to debug.
Reply
#6

not working .. is this the problem of the path of file where it is. maybe its look like this " ../scriptfiles/Gates/Gateid%s.ini "?
Reply
#7

No, the problem is somewhere else. Try to load manual the id 0 and check what happens. If it's still don't load then the problem is most likely inside of LoadGate_gatedata.
Reply
#8

How can i load it? my derby contains some gates which isn't loading
Reply
#9

what you mean by id 0?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)