Listbox - Waffen geben, User bekommt aber trotzdem eine Mischung aus allem.

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
  • Alsoo, folgender Code:
    if(listitem == 0)
    {
    SetPlayerHealth(playerid, 100);
    GivePlayerWeapon(playerid, 4, 9999);
    GivePlayerWeapon(playerid, 23, 250);
    GivePlayerWeapon(playerid, 25, 500);
    GivePlayerWeapon(playerid, 28, 600);
    GivePlayerWeapon(playerid, 31, 1000);
    TogglePlayerControllable(playerid, 1);
    }
    if(listitem == 1)
    {
    SetPlayerHealth(playerid, 50);
    GivePlayerWeapon(playerid, 4, 9999);
    GivePlayerWeapon(playerid, 24, 250);
    GivePlayerWeapon(playerid, 25, 500);
    GivePlayerWeapon(playerid, 29, 650);
    GivePlayerWeapon(playerid, 30, 1000);
    TogglePlayerControllable(playerid, 1);
    }
    if(listitem == 2)
    {
    SetPlayerHealth(playerid, 1);
    GivePlayerWeapon(playerid, 1, 9999);
    GivePlayerWeapon(playerid, 6, 9999);
    GivePlayerWeapon(playerid, 16, 15);
    GivePlayerWeapon(playerid, 24, 500);
    GivePlayerWeapon(playerid, 25, 750);
    GivePlayerWeapon(playerid, 32, 500);
    GivePlayerWeapon(playerid, 30, 1000);
    GivePlayerWeapon(playerid, 38, 9999);
    TogglePlayerControllable(playerid, 1);
    }
    Soweit richtig, aber es ist dann eine Mischung aus allem... d.h. Ich wähle Waffenpaket 2 und habe dabei eine Mischung aus allen 3. Gehts nicht irgendwie anders...?

  • Edit/

    if(listitem == 1)
    {
    SetPlayerHealth(playerid, 100);
    GivePlayerWeapon(playerid, 4, 9999);
    GivePlayerWeapon(playerid, 23, 250);
    GivePlayerWeapon(playerid, 25, 500);
    GivePlayerWeapon(playerid, 28, 600);
    GivePlayerWeapon(playerid, 31, 1000);
    TogglePlayerControllable(playerid, 1);
    }
    if(listitem == 2)
    {
    SetPlayerHealth(playerid, 50);
    GivePlayerWeapon(playerid, 4, 9999);
    GivePlayerWeapon(playerid, 24, 250);
    GivePlayerWeapon(playerid, 25, 500);
    GivePlayerWeapon(playerid, 29, 650);
    GivePlayerWeapon(playerid, 30, 1000);
    TogglePlayerControllable(playerid, 1);
    }
    if(listitem == 3)
    {
    SetPlayerHealth(playerid, 1);
    GivePlayerWeapon(playerid, 1, 9999);
    GivePlayerWeapon(playerid, 6, 9999);
    GivePlayerWeapon(playerid, 16, 15);
    GivePlayerWeapon(playerid, 24, 500);
    GivePlayerWeapon(playerid, 25, 750);
    GivePlayerWeapon(playerid, 32, 500);
    GivePlayerWeapon(playerid, 30, 1000);
    GivePlayerWeapon(playerid, 38, 9999);
    TogglePlayerControllable(playerid, 1);
    }