Pickups wont show up. -
Shetch - 18.02.2012
Hey guys, i got a little problem here.
So i made a property system based on Sandra's one, only my system savas the properties and you can buy them.
All of them show up once i run the GM for the first time, but they don't show up once i run it the second time...??
Here's the system code witch shows the pickups.
Oh, and it's made with dini.
Код:
stock AddProperty(const name[], const description[], value, interior, level, Float:enterX, Float:enterY, Float:enterZ, Float:exitX, Float:exitY, Float:exitZ)
{
new file[128];
format(file,sizeof(file),"Properties/%s.txt",name);
PropertyCount++;
WorldCount++;
new ID = PropertyCount;
new world = WorldCount;
if(dini_Exists(file))
{
format(Property[ID][Name],64,"%s", dini_Get(file,"Name"));
format(Property[ID][Owner],64,"%s", dini_Get(file,"Owner"));
format(Property[ID][Description],64,"%s", dini_Get(file,"Description"));
Property[ID][Value] = dini_Int(file,"Value");
Property[ID][Level] = dini_Int(file,"Level");
Property[ID][Interior] = dini_Int(file,"Interior");
Property[ID][VirtualWorld] = dini_Int(file,"VirtualWorld");
Property[ID][Locked] = bool:dini_Bool(file,"Locked");
Property[ID][Bought] = bool:dini_Bool(file,"Bought");
Property[ID][EnterX] = Float:dini_Float(file,"EnterX");
Property[ID][EnterY] = Float:dini_Float(file,"EnterY");
Property[ID][EnterZ] = Float:dini_Float(file,"EnterZ");
Property[ID][ExitX] = Float:dini_Float(file,"ExitX");
Property[ID][ExitY] = Float:dini_Float(file,"ExitY");
Property[ID][ExitZ] = Float:dini_Float(file,"ExitZ");
}
if(!dini_Exists(file))
{
format(Property[ID][Name],64,"%s", name);
format(Property[ID][Owner],64,"None");
format(Property[ID][Description],64,"%s", description);
Property[ID][Value] = value;
Property[ID][Level] = level;
Property[ID][Interior] = interior;
Property[ID][VirtualWorld] = world;
Property[ID][Locked] = false;
Property[ID][Bought] = false;
Property[ID][EnterX] = enterX;
Property[ID][EnterY] = enterY;
Property[ID][EnterZ] = enterZ;
Property[ID][ExitX] = exitX;
Property[ID][ExitY] = exitY;
Property[ID][ExitZ] = exitZ;
dini_Create(file);
dini_Set(file,"Name",Property[ID][Name]);
dini_Set(file,"Owner",Property[ID][Owner]);
dini_Set(file,"Description",Property[ID][Description]);
dini_IntSet(file,"Value",Property[ID][Value]);
dini_IntSet(file,"Level",Property[ID][Level]);
dini_IntSet(file,"Interior",Property[ID][Interior]);
dini_IntSet(file,"VirtualWorld",Property[ID][VirtualWorld]);
dini_BoolSet(file,"Locked",Property[ID][Locked]);
dini_BoolSet(file,"Bought",Property[ID][Bought]);
dini_FloatSet(file,"EnterX",Property[ID][EnterX]);
dini_FloatSet(file,"EnterY",Property[ID][EnterY]);
dini_FloatSet(file,"EnterZ",Property[ID][EnterZ]);
dini_FloatSet(file,"ExitX",Property[ID][ExitX]);
dini_FloatSet(file,"ExitY",Property[ID][ExitY]);
dini_FloatSet(file,"ExitZ",Property[ID][ExitZ]);
}
PropertyEnterPickup[ID] = CreateDynamicPickup(1273, 1, Property[ID][EnterX], Property[ID][EnterY], Property[ID][EnterZ], 0, 0);
PropertyExitPickup[ID] = CreateDynamicPickup(1273, 1, Property[ID][ExitX], Property[ID][ExitY], Property[ID][ExitZ], Property[ID][VirtualWorld], Property[ID][Interior]);
CreateDynamic3DTextLabel("{FFFFFF}[{808000}Property{FFFFFF}]", 0x5151FFC8, Property[ID][EnterX], Property[ID][EnterY], Property[ID][EnterZ]+0.5, 15, 0);
return ID;
}
Here's the code in my GameMode:
Код:
AddProperty("Edgebook st. #01", "1 Bedroom", 20000, 2, 10, -362.3729,1110.6323,20.9399, 2468.0210,-1698.2465,1013.5078);
AddProperty("Edgebook st. #02", "2 Bedroom", 50000, 2, 40, -324.3443,1165.1569,20.9399, 2468.0210,-1698.2465,1013.5078);
AddProperty("Edgebook st. #03", "1 Bedroom", 30000, 2, 10, -328.8089,1118.8810,20.9399, 2468.0210,-1698.2465,1013.5078);
AddProperty("Edgebook st. #04", "3 Bedroom", 70000, 2, 150, -298.2751,1115.3801,20.9399, 2468.0210,-1698.2465,1013.5078);
AddProperty("Edgebook st. #05", "2 Bedroom", 40000, 2, 430, -360.2277,1141.8267,20.9399, 2468.0210,-1698.2465,1013.5078);
These are the five properties, the fifth one shows up, the other 4 don't.
Can someone please help me?