// Hat sich erledigt, danke an alle
Und ein ganz herzliches Dankeschön an Haxler, der am Ende eine Lösung für das Problem hatte ![]()
LG
// Hat sich erledigt, danke an alle
Und ein ganz herzliches Dankeschön an Haxler, der am Ende eine Lösung für das Problem hatte ![]()
LG
Versuch den Text mal außerhalb der Schleife anzeigen zu lassen:
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new C; C<BusinessCount+1; C++)
{
if(pickupid == BusinessPickup[C])
{
new str[150];
if(BusinessInfo[C][BusOwner] == -1) format(str, sizeof(str), "''%s'' ~n~~r~Preis: ~w~$%d ~n~~r~Verkaufspreis: ~w~$%d ~n~~r~Einnahmen: ~w~$%d", BusinessInfo[C][BusName], BusinessInfo[C][BusCost], BusinessInfo[C][BusSell], BusinessInfo[C][BusEarn]);
if(BusinessInfo[C][BusOwner] != -1)
{
new Pname[24];
GetPlayerName(BusinessInfo[C][BusOwner], Pname, 24);
format(str, sizeof(str), "''%s'' ~n~~r~Preis: ~w~$%d ~n~~r~Verkaufspreis: ~w~$%d ~n~~r~Einnahmen: ~w~$%d ~n~~r~Besitzer: ~w~%s(%d)", BusinessInfo[C][BusName], BusinessInfo[C][BusCost], BusinessInfo[C][BusSell], BusinessInfo[C][BusEarn], Pname, BusinessInfo[C][BusOwner]);
}
}
GameTextForPlayer(playerid, str, 3000, 3);
}
if(pickupid == lalala)
{
Lalala
}
Ich denke das wird nicht klappen, da str nur oben definiert ist:
}
GameTextForPlayer(playerid, str, 3000, 3); // str
}
Beim compilen ebenfalls: undefinied symbol str.. und wenn ich str über GameTextForPlayer nochmal definiere, würde das doch rein garnichts bringen, da der Text str ja oben steht:
format(str, sizeof(str), "''%s'' ~n~~r~Preis: ~w~$%d ~n~~r~Verkaufspreis: ~w~$%d ~n~~r~Einnahmen: ~w~$%d ~n~~r~Besitzer: ~w~%s(%d)", BusinessInfo[C][BusName], BusinessInfo[C][BusCost], BusinessInfo[C][BusSell], BusinessInfo[C][BusEarn], Pname, BusinessInfo[C][BusOwner]);
LG
// Edit: Habs getestet, klappt leider immernochnicht.
Vielleicht jemand anders eine Lösung dafür?
Zeig mal den Code wo du das Pickup erstellst...
stock CreateBusiness(BusinessName[], Float:XPos, Float:YPos, Float:ZPos, Price, Sell, Earn)
{
if(!strlen(BusinessName)) return 0;
BusinessCount ++;
BusinessInfo[BusinessCount][BusX] = XPos;
BusinessInfo[BusinessCount][BusY] = YPos;
BusinessInfo[BusinessCount][BusZ] = ZPos;
BusinessInfo[BusinessCount][BusCost] = Price;
BusinessInfo[BusinessCount][BusSell] = Sell;
BusinessInfo[BusinessCount][BusEarn] = Earn;
BusinessInfo[BusinessCount][BusOwner] = -1;
BusinessPickup[BusinessCount] = AddStaticPickup(1274, 19, XPos, YPos, ZPos, -1);
format(BusinessInfo[BusinessCount][BusName], 60, "%s", BusinessName);
return BusinessCount;
}
new BusinessPickup[MAX_BUSINESSES];
new BusinessCount = -1;
Mach es so:
stock CreateBusiness(BusinessName[], Float:XPos, Float:YPos, Float:ZPos, Price, Sell, Earn)
{
if(!strlen(BusinessName)) return 0;
BusinessCount ++;
BusinessInfo[BusinessCount][BusX] = XPos;
BusinessInfo[BusinessCount][BusY] = YPos;
BusinessInfo[BusinessCount][BusZ] = ZPos;
BusinessInfo[BusinessCount][BusCost] = Price;
BusinessInfo[BusinessCount][BusSell] = Sell;
BusinessInfo[BusinessCount][BusEarn] = Earn;
BusinessInfo[BusinessCount][BusOwner] = -1;
BusinessPickup[BusinessCount] = AddStaticPickup(1274, 1, XPos, YPos, ZPos, -1);
format(BusinessInfo[BusinessCount][BusName], 60, "%s", BusinessName);
return BusinessCount;
}
Das funktioniert leider auch nicht, trotzdem danke. Damit wird nur der PickupTyp geändert, aber daran kann es nicht liegen
Trotzdem danke
//
Wirklich keiner eine Lösung? ![]()
Mach mal in deinem Script par print´s dann sieht man ob es überhaupt ausgeführt wird.
Funktion: print()