24.11.2013, 17:04
I have a game mode that sends a RCon command to load my map fs, in my map fs, I have some coordinates that is globalise by Incognito's GVar plugin, but I cannot retrieve the variable from my game mode after sending the RCon command, do I have to wait for the map to load first?
My game mode(Related codes only)
Map map FS(Related codes to debug only)
Server Log
The map was loaded but the global vars don't work
What did I do wrong? I think it's the code sequence
My game mode(Related codes only)
pawn Код:
new Map[][2][150] =
{
{
{" The Park Outbreak"}, //I don't know why but my script skips the first 2 characters for this var, if you can help me on this pls help
{" theparkoutbreak"} //if I do not put the spacing this line will be eparkoutbreak
}
};
new Float:EscapeEntranceGateCoord[3][2][3];
new Float:HumanSpawnPoint[5][4];
main()
{
SetTimer("LoadMap", 1, false);
}
public LoadMap()
{
SendClientMessageToAll(GAME_MESSAGE_COLOR, "Loading map, please wait");
GameTextForAll("Loading Map", 3000, GAME_GAMETEXT_STYLE);
new RconCommand[150];
new NextMapID = GetGVarInt("NextMapID"); //<< 0
format(RconCommand, sizeof(RconCommand), "loadfs %s", Map[NextMapID][1]);
SendRconCommand(RconCommand);
EscapeEntranceGateCoord[0][0][0] = GetGVarFloat("EscapeEntrance1Gate1CoordX");
EscapeEntranceGateCoord[0][0][1] = GetGVarFloat("EscapeEntrance1Gate1CoordY");
EscapeEntranceGateCoord[0][0][2] = GetGVarFloat("EscapeEntrance1Gate1CoordZ");
EscapeEntranceGateCoord[0][1][0] = GetGVarFloat("EscapeEntrance1Gate2CoordX");
EscapeEntranceGateCoord[0][1][1] = GetGVarFloat("EscapeEntrance1Gate2CoordY");
EscapeEntranceGateCoord[0][1][2] = GetGVarFloat("EscapeEntrance1Gate2CoordZ");
EscapeEntranceGateCoord[1][0][0] = GetGVarFloat("EscapeEntrance2Gate1CoordX");
EscapeEntranceGateCoord[1][0][1] = GetGVarFloat("EscapeEntrance2Gate1CoordY");
EscapeEntranceGateCoord[1][0][2] = GetGVarFloat("EscapeEntrance2Gate1CoordZ");
EscapeEntranceGateCoord[1][1][0] = GetGVarFloat("EscapeEntrance2Gate2CoordX");
EscapeEntranceGateCoord[1][1][1] = GetGVarFloat("EscapeEntrance2Gate2CoordY");
EscapeEntranceGateCoord[1][1][2] = GetGVarFloat("EscapeEntrance2Gate2CoordZ");
EscapeEntranceGateCoord[2][0][0] = GetGVarFloat("EscapeEntrance3Gate1CoordX");
EscapeEntranceGateCoord[2][0][1] = GetGVarFloat("EscapeEntrance3Gate1CoordY");
EscapeEntranceGateCoord[2][0][2] = GetGVarFloat("EscapeEntrance3Gate1CoordZ");
EscapeEntranceGateCoord[2][1][0] = GetGVarFloat("EscapeEntrance3Gate2CoordX");
EscapeEntranceGateCoord[2][1][1] = GetGVarFloat("EscapeEntrance3Gate2CoordY");
EscapeEntranceGateCoord[2][1][2] = GetGVarFloat("EscapeEntrance3Gate2CoordZ");
printf("Test: %f, %f, %f", EscapeEntranceGateCoord[2][1][0], EscapeEntranceGateCoord[2][1][1], EscapeEntranceGateCoord[2][1][2]);
HumanSpawnPoint[0][0] = GetGVarFloat("HumanSpawnPoint1X");
HumanSpawnPoint[0][1] = GetGVarFloat("HumanSpawnPoint1Y");
HumanSpawnPoint[0][2] = GetGVarFloat("HumanSpawnPoint1Z");
HumanSpawnPoint[0][3] = GetGVarFloat("HumanSpawnPoint1A");
HumanSpawnPoint[1][0] = GetGVarFloat("HumanSpawnPoint2X");
HumanSpawnPoint[1][1] = GetGVarFloat("HumanSpawnPoint2Y");
HumanSpawnPoint[1][2] = GetGVarFloat("HumanSpawnPoint2Z");
HumanSpawnPoint[1][3] = GetGVarFloat("HumanSpawnPoint2A");
HumanSpawnPoint[2][0] = GetGVarFloat("HumanSpawnPoint3X");
HumanSpawnPoint[2][1] = GetGVarFloat("HumanSpawnPoint3Y");
HumanSpawnPoint[2][2] = GetGVarFloat("HumanSpawnPoint3Z");
HumanSpawnPoint[2][3] = GetGVarFloat("HumanSpawnPoint3A");
printf("Test2: %f, %f, %f, %f", HumanSpawnPoint[2][0], HumanSpawnPoint[2][1], HumanSpawnPoint[2][2], HumanSpawnPoint[2][3]);
HumanSpawnPoint[3][0] = GetGVarFloat("HumanSpawnPoint4X");
HumanSpawnPoint[3][1] = GetGVarFloat("HumanSpawnPoint4Y");
HumanSpawnPoint[3][2] = GetGVarFloat("HumanSpawnPoint4Z");
HumanSpawnPoint[3][3] = GetGVarFloat("HumanSpawnPoint4A");
HumanSpawnPoint[4][0] = GetGVarFloat("HumanSpawnPoint5X");
HumanSpawnPoint[4][1] = GetGVarFloat("HumanSpawnPoint5Y");
HumanSpawnPoint[4][2] = GetGVarFloat("HumanSpawnPoint5Z");
HumanSpawnPoint[4][3] = GetGVarFloat("HumanSpawnPoint5A");
}
pawn Код:
new Float:EscapeEntranceGateCoord[3][2][3] =
{
{
{1810.935791, -1424.656738, 16.111074},
{1812.689208, -1424.660278, 16.111612}
},
{
{1986.290649, -1525.501098, 24.934429},
{1986.214477, -1527.268920, 24.932504}
},
{
{1973.812011, -1241.875122, 24.465534},
{1975.552001, -1241.647094, 24.465539}
}
};
new Float:HumanSpawnPoint[5][4] =
{
{1907.5391, -1570.3154, 22.2424, 182.7103},
{2044.2927, -1400.1689, 84.3743, 84.3338},
{1976.0824, -1282.5011, 38.5050, 17.3310},
{1909.7496, -1301.6178, 69.2367, 130.3235},
{1819.6625, -1413.5164, 29.8772, 180.4687}
};
public Map()
{
//This functionis called at OnFilterScriptInit
//This function contains the createobject function
SetTimer("GlobaliseVariable", 1, false);
}
public GlobaliseVariable()
{
SetGVarFloat("EscapeEntrance1Gate1CoordX", EscapeEntranceGateCoord[0][0][0]);
SetGVarFloat("EscapeEntrance1Gate1CoordY", EscapeEntranceGateCoord[0][0][1]);
SetGVarFloat("EscapeEntrance1Gate1CoordZ", EscapeEntranceGateCoord[0][0][2]);
SetGVarFloat("EscapeEntrance1Gate2CoordX", EscapeEntranceGateCoord[0][1][0]);
SetGVarFloat("EscapeEntrance1Gate2CoordY", EscapeEntranceGateCoord[0][1][1]);
SetGVarFloat("EscapeEntrance1Gate2CoordZ", EscapeEntranceGateCoord[0][1][2]);
SetGVarFloat("EscapeEntrance2Gate1CoordX", EscapeEntranceGateCoord[1][0][0]);
SetGVarFloat("EscapeEntrance2Gate1CoordY", EscapeEntranceGateCoord[1][0][1]);
SetGVarFloat("EscapeEntrance2Gate1CoordZ", EscapeEntranceGateCoord[1][0][2]);
SetGVarFloat("EscapeEntrance2Gate2CoordX", EscapeEntranceGateCoord[1][1][0]);
SetGVarFloat("EscapeEntrance2Gate2CoordY", EscapeEntranceGateCoord[1][1][1]);
SetGVarFloat("EscapeEntrance2Gate2CoordZ", EscapeEntranceGateCoord[1][1][2]);
SetGVarFloat("EscapeEntrance3Gate1CoordX", EscapeEntranceGateCoord[2][0][0]);
SetGVarFloat("EscapeEntrance3Gate1CoordY", EscapeEntranceGateCoord[2][0][1]);
SetGVarFloat("EscapeEntrance3Gate1CoordZ", EscapeEntranceGateCoord[2][0][2]);
SetGVarFloat("EscapeEntrance3Gate2CoordX", EscapeEntranceGateCoord[2][1][0]);
SetGVarFloat("EscapeEntrance3Gate2CoordY", EscapeEntranceGateCoord[2][1][1]);
SetGVarFloat("EscapeEntrance3Gate2CoordZ", EscapeEntranceGateCoord[2][1][2]);
SetGVarFloat("HumanSpawnPoint1X", HumanSpawnPoint[0][0]);
SetGVarFloat("HumanSpawnPoint1Y", HumanSpawnPoint[0][1]);
SetGVarFloat("HumanSpawnPoint1Z", HumanSpawnPoint[0][2]);
SetGVarFloat("HumanSpawnPoint1A", HumanSpawnPoint[0][3]);
SetGVarFloat("HumanSpawnPoint2X", HumanSpawnPoint[1][0]);
SetGVarFloat("HumanSpawnPoint2Y", HumanSpawnPoint[1][1]);
SetGVarFloat("HumanSpawnPoint2Z", HumanSpawnPoint[1][2]);
SetGVarFloat("HumanSpawnPoint2A", HumanSpawnPoint[1][3]);
SetGVarFloat("HumanSpawnPoint3X", HumanSpawnPoint[2][0]);
SetGVarFloat("HumanSpawnPoint3Y", HumanSpawnPoint[2][1]);
SetGVarFloat("HumanSpawnPoint3Z", HumanSpawnPoint[2][2]);
SetGVarFloat("HumanSpawnPoint3A", HumanSpawnPoint[2][3]);
SetGVarFloat("HumanSpawnPoint4X", HumanSpawnPoint[3][0]);
SetGVarFloat("HumanSpawnPoint4Y", HumanSpawnPoint[3][1]);
SetGVarFloat("HumanSpawnPoint4Z", HumanSpawnPoint[3][2]);
SetGVarFloat("HumanSpawnPoint4A", HumanSpawnPoint[3][3]);
SetGVarFloat("HumanSpawnPoint5X", HumanSpawnPoint[4][0]);
SetGVarFloat("HumanSpawnPoint5Y", HumanSpawnPoint[4][1]);
SetGVarFloat("HumanSpawnPoint5Z", HumanSpawnPoint[4][2]);
SetGVarFloat("HumanSpawnPoint5A", HumanSpawnPoint[4][3]);
}
Код:
[01:49:58] Filterscript 'theparkoutbreak.amx' loaded. [01:49:58] Test: 0.000000, 0.000000, 0.000000 [01:49:58] Test2: 0.000000, 0.000000, 0.000000, 0.000000 [01:49:58]
What did I do wrong? I think it's the code sequence