18.09.2014, 15:13
(
Последний раз редактировалось Manyula; 19.09.2014 в 09:30.
)
Hi there,
I'll dig right into it:
I have a couple of 3DTextLabels that I create with a loop. Like this:
I have created a little language system, which allows the player to switch between two languages.
Everytime a player changes his/her language, the 3DTextLabels should be updated to the translated version.
However, it does not update the given text.
This is one example of what I have under my stock function "UpdateLanguageLabels(playerid);"
Does anybody know how to solve this? I really can't find any mistake.
------------------------------------------------------------------------------------------------------------------------------
Here is the full function + defines and variriables that are needed:
The thing is that I create both the TeleportLabels and the GangZoneLabels the exact same way, but only the GangZoneLabels seem to work.
As you can see, I packed the TeleportLabels into a loop and debugged it. It prints everything from 0 to MAX_TELEPORT_LABELS, and even passes the values specified in "case", however, the updating functions are not being executed.
I'll dig right into it:
I have a couple of 3DTextLabels that I create with a loop. Like this:
pawn Код:
for(new i = 0; i < MAX_TELEPORT_LABELS; i++)
{
for(new g = 0; g < MAX_PLAYERS; g++)
{
TeleportLabel[g][i] = CreateDynamic3DTextLabel("» Teleport «\n"#C_WHITE_E"Los Santos\n/LS", C_PURPLE, 2492.7268, -1668.3849, 13.3438, 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, g, 50.0);
//code...
}
}
Everytime a player changes his/her language, the 3DTextLabels should be updated to the translated version.
However, it does not update the given text.
This is one example of what I have under my stock function "UpdateLanguageLabels(playerid);"
pawn Код:
UpdateDynamic3DTextLabelText(TeleportLabel[playerid][16], C_PURPLE, "» Teleport «\n"#C_WHITE_E"San Fierro Denkmal\n/SFD");
------------------------------------------------------------------------------------------------------------------------------
Here is the full function + defines and variriables that are needed:
pawn Код:
#define MAX_TELEPORT_LABELS 29
new Text3D:TeleportLabel[MAX_PLAYERS][MAX_TELEPORT_LABELS];
#undef MAX_GANG_ZONES
#define MAX_GANG_ZONES 83
new Text3D:GangZoneLabel[MAX_PLAYERS][MAX_GANG_ZONES];
stock UpdateLanguageLabels(playerid)
{
if(pInfo[playerid][Language] == LANGUAGE_DE)
{
new string[128];
for(new i = 0; i < MAX_GANG_ZONES; i++)
{
format(string, sizeof(string), "» GANG ZONE «\n"#C_WHITE_E"ID: %i\n%s", i, GW_Name[i][0]);
UpdateDynamic3DTextLabelText(GangZoneLabel[playerid][i], C_ORANGE, string);
}
for(new t = 0; t < MAX_TELEPORT_LABELS; t++)
{
printf("%i", t);
switch(t)
{
case 16: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"San Fierro Denkmal\n/SFD");
case 23: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"The Big Ear Satellit-Station\n/Satellit");
case 24: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"Verlassener Flughafen\n/VF");
case 27: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"Geistersee\n/GS");
}
}
return 1;
}
if(pInfo[playerid][Language] == LANGUAGE_EN)
{
new string[128];
for(new i = 0; i < MAX_GANG_ZONES; i++)
{
format(string, sizeof(string), "» GANG ZONE «\n"#C_WHITE_E"ID: %i\n%s", i, GW_Name[i][1]);
UpdateDynamic3DTextLabelText(GangZoneLabel[playerid][i], C_ORANGE, string);
}
for(new t = 0; t < MAX_TELEPORT_LABELS; t++)
{
printf("%i", t);
switch(t)
{
case 16: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"San Fierro Memorial\n/SFM");
case 23: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"The Big Ear Satellite Station\n/Satellite");
case 24: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"Abandoned Airport\n/AA");
case 27: UpdateDynamic3DTextLabelText(TeleportLabel[playerid][t], C_PURPLE, "» Teleport «\n"#C_WHITE_E"Ghost Lake\n/GL");
}
}
return 1;
}
return 1;
}
As you can see, I packed the TeleportLabels into a loop and debugged it. It prints everything from 0 to MAX_TELEPORT_LABELS, and even passes the values specified in "case", however, the updating functions are not being executed.