OnPlayerPickUpPickup - wird nicht aufgerufen

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Guten Abend,


    die folgende Funktion wird nicht aufgerufen, enum sowie Koordinaten stimmen:


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    for(new h = 0; h < sizeof(AutomatikPortInfo); h++)
    {
    if(pickupid == AutomatikPortInfo[h][APAusgangPickup] && PortedTimer[playerid] == 0 && GetPlayerVirtualWorld(playerid) == AutomatikPortInfo[h][APVirtualWorld])
    {
    SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, AutomatikPortInfo[h][APEingangX], AutomatikPortInfo[h][APEingangY], AutomatikPortInfo[h][APEingangZ]);
    SetPlayerVirtualWorld(playerid, 0); PortedTimer[playerid] = 5; PlayerInfo[playerid][pLocal] = -1;
    printf("Test I");
    return 1;
    }
    if(pickupid == AutomatikPortInfo[h][APEingangPickup] && PortedTimer[playerid] == 0)
    {
    SetPlayerInterior(playerid, AutomatikPortInfo[h][APInterior]);
    SetPlayerPos(playerid, AutomatikPortInfo[h][APAusgangX], AutomatikPortInfo[h][APAusgangY], AutomatikPortInfo[h][APAusgangZ]); SetPlayerVirtualWorld(playerid, AutomatikPortInfo[h][APVirtualWorld]); PortedTimer[playerid] = 5; PlayerInfo[playerid][pLocal] = AutomatikPortInfo[h][APLocation];
    printf("Test II");
    return 1;
    }
    }

  • Müsste das nich so sein oder lieg ich jetzt falsch?


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    for(new h = 0; h < sizeof(AutomatikPortInfo); h++)
    {
    if(pickupid == AutomatikPortInfo[h][APAusgangPickup])
    {
    if(PortedTimer[playerid] == 0 && GetPlayerVirtualWorld(playerid) == AutomatikPortInfo[h][APVirtualWorld])
    {
    SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, AutomatikPortInfo[h][APEingangX], AutomatikPortInfo[h][APEingangY], AutomatikPortInfo[h][APEingangZ]);
    SetPlayerVirtualWorld(playerid, 0); PortedTimer[playerid] = 5; PlayerInfo[playerid][pLocal] = -1;
    printf("Test I");
    return 1;
    }
    }
    if(pickupid == AutomatikPortInfo[h][APEingangPickup] && PortedTimer[playerid] == 0)
    {
    SetPlayerInterior(playerid, AutomatikPortInfo[h][APInterior]);
    SetPlayerPos(playerid, AutomatikPortInfo[h][APAusgangX], AutomatikPortInfo[h][APAusgangY], AutomatikPortInfo[h][APAusgangZ]); SetPlayerVirtualWorld(playerid, AutomatikPortInfo[h][APVirtualWorld]); PortedTimer[playerid] = 5; PlayerInfo[playerid][pLocal] = AutomatikPortInfo[h][APLocation];
    printf("Test II");
    return 1;
    }
    }
    und das gleiche beim andern? Weil du musst doch die Pickupid einzeln abfragen und dann denn rest.

    seekrass approved
    4x vom Discord geflogen


    shoxinat0r 4
    dennismitzwein 2
    Trooper[Y] 2
    maddin 1
    Unbekannter Discord Kick 2
  • Wenn du CreateDynamicPickup verwendest, kannst du das nicht unter OnPLayerPickUpPickUp packen, da diese nur für CreatePickups sind, mach so :) :

    public OnPlayerPickUpDynamicPickup(playerid, pickupid)
    {
    for(new h = 0; h < sizeof(AutomatikPortInfo); h++)
    {
    if(pickupid == AutomatikPortInfo[h][APAusgangPickup] && PortedTimer[playerid] == 0 && GetPlayerVirtualWorld(playerid) == AutomatikPortInfo[h][APVirtualWorld])
    {
    SetPlayerInterior(playerid, 0); SetPlayerPos(playerid, AutomatikPortInfo[h][APEingangX], AutomatikPortInfo[h][APEingangY], AutomatikPortInfo[h][APEingangZ]);
    SetPlayerVirtualWorld(playerid, 0); PortedTimer[playerid] = 5; PlayerInfo[playerid][pLocal] = -1;
    printf("Test I");
    return 1;
    }
    if(pickupid == AutomatikPortInfo[h][APEingangPickup] && PortedTimer[playerid] == 0)
    {
    SetPlayerInterior(playerid, AutomatikPortInfo[h][APInterior]);
    SetPlayerPos(playerid, AutomatikPortInfo[h][APAusgangX], AutomatikPortInfo[h][APAusgangY], AutomatikPortInfo[h][APAusgangZ]); SetPlayerVirtualWorld(playerid, AutomatikPortInfo[h][APVirtualWorld]); PortedTimer[playerid] = 5; PlayerInfo[playerid][pLocal] = AutomatikPortInfo[h][APLocation];
    printf("Test II");
    return 1;
    }
    }
    return 1;
    }