27.03.2011, 17:54
So i have
Under OnGameModeInit, and after that i'm adding player classes, setting mode name etc.
The problem is, that anything that should be loaded after this code just doesn't load and my mode is set to Unknown.
LoadDoor function.
This code works fine in my other GM.
pawn Code:
if(!fexist(DOORS_FILE))
{
print("NO DOOR FILE! CREATING A NEW ONE!");
fcreate(DOORS_FILE);
return 1;
}
else
{
for(new d=0;d<MAX_DOORS;d++)
{
new string[128];
format(string, sizeof(string),"Door_%d",d);
if(djIsSet(DOORS_FILE, string))
{
LoadDoor(d);
return 1;
}
return 1;
}
}
The problem is, that anything that should be loaded after this code just doesn't load and my mode is set to Unknown.
LoadDoor function.
pawn Code:
public LoadDoor(id)
{
new string2[128], name[128];
DestroyDynamicPickup(DoorInfo[id][dPp]);
format(string2, sizeof(string2),"Door_%d/ExteriorX", id); DoorInfo[id][dExteriorX] = djFloat(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/ExteriorY", id); DoorInfo[id][dExteriorY] = djFloat(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/ExteriorZ", id); DoorInfo[id][dExteriorZ] = djFloat(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/ExteriorInt", id); DoorInfo[id][dExteriorInt] = djInt(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/InteriorX", id); DoorInfo[id][dInteriorX] = djFloat(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/InteriorY", id); DoorInfo[id][dInteriorY] = djFloat(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/InteriorZ", id); DoorInfo[id][dInteriorZ] = djFloat(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/InteriorInt", id); DoorInfo[id][dInteriorInt] = djInt(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/Type", id); DoorInfo[id][dType] = djInt(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/Team", id); DoorInfo[id][dTeam] = djInt(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/Owned", id); DoorInfo[id][dOwned] = djInt(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/Owner", id); format(name, sizeof(name), "%s", dj(DOORS_FILE, string2)); DoorInfo[id][dOwner] = name;
format(string2, sizeof(string2),"Door_%d/Locked", id); DoorInfo[id][dLocked] = djInt(DOORS_FILE, string2);
format(string2, sizeof(string2),"Door_%d/Name", id); format(name, sizeof(name), "%s", dj(DOORS_FILE, string2)); DoorInfo[id][dName] = name;
Itter_Add(Doors, Iter_Count(Doors) + 1);
DoorInfo[id][dPp] = CreateDynamicPickup(1239, 2, DoorInfo[id][dExteriorX], DoorInfo[id][dExteriorY], DoorInfo[id][dExteriorZ], -1, DoorInfo[id][dExteriorInt], -1, 50.0);
if(DoorInfo[id][dType] == 1)
{
DoorInfo[id][dLocked] = 0;
return 1;
}
else if(DoorInfo[id][dType] == 2)
{
DoorInfo[id][dLocked] = 1;
return 1;
}
return 1;
}