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;
}