Hallo alle mit einander,
Ich hab ein kleines Problem:
Ich hab in meinem Script ein neuen Dialog hinzugefügt wie sonst auch. Nun ist aber das Problem, dass mein Dialog nicht geöffnet wird. vielleicht könnt ihr den Fehler entdecken.
ShowDialog:TuningGarage_Neon(playerID)
{
new list[1024];
ConcatString(list, LanguageString(playerID, StringID:251("Neon Color: Green")), "\n");
ConcatString(list, LanguageString(playerID, StringID:252("Neon Color: Blue")), "\n");
ConcatString(list, LanguageString(playerID, StringID:253("Neon Color: Yellow")), "\n");
ConcatString(list, LanguageString(playerID, StringID:254("Neon Color: Violet")), "\n");
ConcatString(list, LanguageString(playerID, StringID:255("Neon Color: White")), "\n");
ConcatString(list, LanguageString(playerID, StringID:256("Neon Color: Red")), "\n");
printf("Dialog loading....");
CreateDialog(playerID, "TuningGarage_Neon", DIALOG_STYLE_LIST, LanguageString(playerID, StringID:257("Select a Neon")), list, LanguageString(playerID, StringID:37("Next")), LanguageString(playerID, StringID:4("Cancel")));
printf("Dialog loaded");
}
DialogResponse:TuningGarage_Neon(playerID, response, listItem, inputText[])
{
if (response)
{
new tuningPartIndex;
new XMLNode:xml = XML_LoadDocument("vehiclemodels.xml");
xml = XML_GetFirstChild(xml, "vehiclemodels");
new XMLNode:modelNode = XML_GetFirstChild(xml, "model");
while (modelNode)
{
new modelID = XML_GetIntAttribute(modelNode, "id");
if (modelID < 400 || modelID > 611)
{
printf("Invalid vehicle model ID: %d", modelID);
modelNode = XML_GetNextSibling(modelNode, "model");
continue;
}
new arrayIndex = modelID - 400;// First array element starts with 0, vehicle models are starting with 400 (400 - 400 = 0, 401 - 400 = 1, ...)
new tuningPartSlot;
new XMLNode:neonNode = XML_GetFirstChild(modelNode, "neon");
if (neonNode)
{
new Float:neonPosX = XML_GetFloatAttribute(neonNode, "x");
new Float:neonPosY = XML_GetFloatAttribute(neonNode, "y");
new Float:neonPosZ = XML_GetFloatAttribute(neonNode, "z");
new neonPrice = XML_GetIntAttribute(neonNode, "price");
for (new neonModelID = 18647; neonModelID <= 18652; neonModelID++)
{
if (tuningPartSlot >= MAX_TUNINGPARTSPERVEHICLE)
{
printf("Reached limit of %d tuning parts for vehicle %d", MAX_TUNINGPARTSPERVEHICLE, modelID);
break;
}
g_tuningParts[tuningPartIndex][E_TUNINGPART_MODELID] = neonModelID;
g_tuningParts[tuningPartIndex][E_TUNINGPART_PRICE] = neonPrice;
g_tuningParts[tuningPartIndex][E_TUNINGPART_TYPE] = TUNINGPART_NEON;
// Left side
g_tuningParts[tuningPartIndex][E_TUNINGPART_OFFSET_X][0] = -neonPosX;
g_tuningParts[tuningPartIndex][E_TUNINGPART_OFFSET_Y][0] = neonPosY;
g_tuningParts[tuningPartIndex][E_TUNINGPART_OFFSET_Z][0] = neonPosZ;
// Right side
g_tuningParts[tuningPartIndex][E_TUNINGPART_OFFSET_X][1] = neonPosX;
g_tuningParts[tuningPartIndex][E_TUNINGPART_OFFSET_Y][1] = neonPosY;
g_tuningParts[tuningPartIndex][E_TUNINGPART_OFFSET_Z][1] = neonPosZ;
g_vehicleModels[arrayIndex][E_VEHICLEMODEL_TUNINGPARTS][tuningPartSlot] = tuningPartIndex;
tuningPartSlot++;
tuningPartIndex++;
}
}
}
if (listItem == 1)//Green
{
if (GetPlayerMoney(playerID) < TUNINGGARAGE_PRICE_NEON)
{
GameTextForPlayer(playerID, LanguageString(playerID, StringID:80("You do not have enough money!")), 3000, 3);
ShowDialog:TuningGarage_Neon(playerID);
}
else
{
new vehicleID = GetPlayerVehicleID(playerID);
new XMLNode:neonNode = XML_GetFirstChild(modelNode, "neon");
if (neonNode)
{
new Float:neonPosX = XML_GetFloatAttribute(neonNode, "x");
new Float:neonPosY = XML_GetFloatAttribute(neonNode, "y");
new Float:neonPosZ = XML_GetFloatAttribute(neonNode, "z");
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0] = CreateObject(18649,0,0,0,0,0,0);
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1] = CreateObject(18649,0,0,0,0,0,0);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0], GetPlayerVehicleID(playerID), -neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1], GetPlayerVehicleID(playerID), neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
MySQLFormat("UPDATE `vehiclecomponents` SET `componentId` = %d WHERE `vehicleId` = %d AND `slot` = %d", GetVehicleComponentInSlot(vehicleID, CARMODTYPE_NEON), VehicleProperty:vehicleID[SAVEID], CARMODTYPE_NEON);// Neon changes without beeing in a mod shop
mysql_pquery(g_mysql, g_sqlQuery);
ShowDialog:TuningGarage_Neon(playerID);
}
}
}
else
{
ShowDialog:TuningGarage_CategoryTypes(playerID, listItem);
}
if (listItem == 2) //Blue
{
if (GetPlayerMoney(playerID) < TUNINGGARAGE_PRICE_NEON)
{
GameTextForPlayer(playerID, LanguageString(playerID, StringID:80("You do not have enough money!")), 3000, 3);
ShowDialog:TuningGarage_Neon(playerID);
}
else
{
new vehicleID = GetPlayerVehicleID(playerID);
new XMLNode:neonNode = XML_GetFirstChild(modelNode, "neon");
if (neonNode)
{
new Float:neonPosX = XML_GetFloatAttribute(neonNode, "x");
new Float:neonPosY = XML_GetFloatAttribute(neonNode, "y");
new Float:neonPosZ = XML_GetFloatAttribute(neonNode, "z");
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0] = CreateObject(18648,0,0,0,0,0,0);
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1] = CreateObject(18648,0,0,0,0,0,0);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0], GetPlayerVehicleID(playerID), -neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1], GetPlayerVehicleID(playerID), neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
MySQLFormat("UPDATE `vehiclecomponents` SET `componentId` = %d WHERE `vehicleId` = %d AND `slot` = %d", GetVehicleComponentInSlot(vehicleID, CARMODTYPE_NEON), VehicleProperty:vehicleID[SAVEID], CARMODTYPE_NEON);// Neon changes without beeing in a mod shop
mysql_pquery(g_mysql, g_sqlQuery);
ShowDialog:TuningGarage_Neon(playerID);
}
}
}
if (listItem == 3) //Yellow
{
if (GetPlayerMoney(playerID) < TUNINGGARAGE_PRICE_NEON)
{
GameTextForPlayer(playerID, LanguageString(playerID, StringID:80("You do not have enough money!")), 3000, 3);
ShowDialog:TuningGarage_Neon(playerID);
}
else
{
new vehicleID = GetPlayerVehicleID(playerID);
new XMLNode:neonNode = XML_GetFirstChild(modelNode, "neon");
if (neonNode)
{
new Float:neonPosX = XML_GetFloatAttribute(neonNode, "x");
new Float:neonPosY = XML_GetFloatAttribute(neonNode, "y");
new Float:neonPosZ = XML_GetFloatAttribute(neonNode, "z");
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0] = CreateObject(18650,0,0,0,0,0,0);
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1] = CreateObject(18650,0,0,0,0,0,0);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0], GetPlayerVehicleID(playerID), -neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1], GetPlayerVehicleID(playerID), neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
MySQLFormat("UPDATE `vehiclecomponents` SET `componentId` = %d WHERE `vehicleId` = %d AND `slot` = %d", GetVehicleComponentInSlot(vehicleID, CARMODTYPE_NEON), VehicleProperty:vehicleID[SAVEID], CARMODTYPE_NEON);// Neon changes without beeing in a mod shop
mysql_pquery(g_mysql, g_sqlQuery);
ShowDialog:TuningGarage_Neon(playerID);
}
}
}
if (listItem == 4) //Violet
{
if (GetPlayerMoney(playerID) < TUNINGGARAGE_PRICE_NEON)
{
GameTextForPlayer(playerID, LanguageString(playerID, StringID:80("You do not have enough money!")), 3000, 3);
ShowDialog:TuningGarage_Neon(playerID);
}
else
{
new vehicleID = GetPlayerVehicleID(playerID);
new XMLNode:neonNode = XML_GetFirstChild(modelNode, "neon");
if (neonNode)
{
new Float:neonPosX = XML_GetFloatAttribute(neonNode, "x");
new Float:neonPosY = XML_GetFloatAttribute(neonNode, "y");
new Float:neonPosZ = XML_GetFloatAttribute(neonNode, "z");
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0] = CreateObject(18651,0,0,0,0,0,0);
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1] = CreateObject(18651,0,0,0,0,0,0);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0], GetPlayerVehicleID(playerID), -neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1], GetPlayerVehicleID(playerID), neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
MySQLFormat("UPDATE `vehiclecomponents` SET `componentId` = %d WHERE `vehicleId` = %d AND `slot` = %d", GetVehicleComponentInSlot(vehicleID, CARMODTYPE_NEON), VehicleProperty:vehicleID[SAVEID], CARMODTYPE_NEON);// Neon changes without beeing in a mod shop
mysql_pquery(g_mysql, g_sqlQuery);
ShowDialog:TuningGarage_Neon(playerID);
}
}
}
if (listItem == 5) //White
{
if (GetPlayerMoney(playerID) < TUNINGGARAGE_PRICE_NEON)
{
GameTextForPlayer(playerID, LanguageString(playerID, StringID:80("You do not have enough money!")), 3000, 3);
ShowDialog:TuningGarage_Neon(playerID);
}
else
{
new vehicleID = GetPlayerVehicleID(playerID);
new XMLNode:neonNode = XML_GetFirstChild(modelNode, "neon");
if (neonNode)
{
new Float:neonPosX = XML_GetFloatAttribute(neonNode, "x");
new Float:neonPosY = XML_GetFloatAttribute(neonNode, "y");
new Float:neonPosZ = XML_GetFloatAttribute(neonNode, "z");
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0] = CreateObject(18652,0,0,0,0,0,0);
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1] = CreateObject(18652,0,0,0,0,0,0);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0], GetPlayerVehicleID(playerID), -neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1], GetPlayerVehicleID(playerID), neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
MySQLFormat("UPDATE `vehiclecomponents` SET `componentId` = %d WHERE `vehicleId` = %d AND `slot` = %d", GetVehicleComponentInSlot(vehicleID, CARMODTYPE_NEON), VehicleProperty:vehicleID[SAVEID], CARMODTYPE_NEON);// Neon changes without beeing in a mod shop
mysql_pquery(g_mysql, g_sqlQuery);
ShowDialog:TuningGarage_Neon(playerID);
}
}
}
if (listItem == 6) //Red
{
if (GetPlayerMoney(playerID) < TUNINGGARAGE_PRICE_NEON)
{
GameTextForPlayer(playerID, LanguageString(playerID, StringID:80("You do not have enough money!")), 3000, 3);
ShowDialog:TuningGarage_Neon(playerID);
}
else
{
new vehicleID = GetPlayerVehicleID(playerID);
new XMLNode:neonNode = XML_GetFirstChild(modelNode, "neon");
if (neonNode)
{
new Float:neonPosX = XML_GetFloatAttribute(neonNode, "x");
new Float:neonPosY = XML_GetFloatAttribute(neonNode, "y");
new Float:neonPosZ = XML_GetFloatAttribute(neonNode, "z");
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0] = CreateObject(18647,0,0,0,0,0,0);
g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1] = CreateObject(18647,0,0,0,0,0,0);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][0], GetPlayerVehicleID(playerID), -neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
AttachObjectToVehicle(g_tuningParts[tuningPartIndex][E_TUNINGPART_NEON][1], GetPlayerVehicleID(playerID), neonPosX, neonPosY, neonPosZ, 0.000000, 0.000000, 0.000000);
MySQLFormat("UPDATE `vehiclecomponents` SET `componentId` = %d WHERE `vehicleId` = %d AND `slot` = %d", GetVehicleComponentInSlot(vehicleID, CARMODTYPE_NEON), VehicleProperty:vehicleID[SAVEID], CARMODTYPE_NEON);// Neon changes without beeing in a mod shop
mysql_pquery(g_mysql, g_sqlQuery);
ShowDialog:TuningGarage_Neon(playerID);
}
}
}
}
else
{
SaveVehicle(PVar:playerID[TUNINGGARAGE_VEHICLEID]);
SetPlayerVirtualWorld(playerID, 0);
new tuningGarageNumber = PVar:playerID[TUNINGGARAGE_NUMBER];
SetPlayerSpawn(playerID, SPAWNTYPE_EXITTUNINGGARAGE, g_tuningGarages[tuningGarageNumber][E_TUNINGGARAGE_VEHICLE_POSX], g_tuningGarages[tuningGarageNumber][E_TUNINGGARAGE_VEHICLE_POSY], g_tuningGarages[tuningGarageNumber][E_TUNINGGARAGE_VEHICLE_POSZ], g_tuningGarages[tuningGarageNumber][E_TUNINGGARAGE_VEHICLE_ANGLE]);
TogglePlayerSpectating(playerID, false);
PVar:playerID[ALLOWCMDS] = true;
}
}
In meinem Dialog vom Menü klicke ich auf Neon und es kommt einfach garnichts... Weder das Menü Dialog noch das Neon Dialog.
Da ich für die weiteren nur eine rück leitung zum Menü Dialog erstellt habe kommt dort auch immer das Menü Dialog. Geh ich aber dann wieder auf Neon, ist mein Dialog komplett weg. Der neue wird erst garnicht erstellt.
Laut Debug kommt er aber soweit. sogar über das CreateDialog.