Unendlich Munition per Zufall

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
  • Hallo, ich habe ein "kleines" Problemundzwar, ich habe etwas, dass die Waffen beim Disconnecten abgespeichert werden, das sieht so aus:

    Spoiler anzeigen

    new wid, muni;
    GetPlayerWeaponData(playerid,1,wid,muni);
    dini_IntSet(file,"wslot1",wid); dini_IntSet(file,"wslotmuni1",muni);
    GetPlayerWeaponData(playerid,2,wid,muni);
    dini_IntSet(file,"wslot2",wid); dini_IntSet(file,"wslotmuni2",muni);
    GetPlayerWeaponData(playerid,3,wid,muni);
    dini_IntSet(file,"wslot3",wid); dini_IntSet(file,"wslotmuni3",muni);
    GetPlayerWeaponData(playerid,4,wid,muni);
    dini_IntSet(file,"wslot4",wid); dini_IntSet(file,"wslotmuni4",muni);
    GetPlayerWeaponData(playerid,5,wid,muni);
    dini_IntSet(file,"wslot5",wid); dini_IntSet(file,"wslotmuni5",muni);
    GetPlayerWeaponData(playerid,6,wid,muni);
    dini_IntSet(file,"wslot6",wid); dini_IntSet(file,"wslotmuni6",muni);
    GetPlayerWeaponData(playerid,8,wid,muni);
    dini_IntSet(file,"wslot8",wid); dini_IntSet(file,"wslotmuni8",muni);
    GetPlayerWeaponData(playerid,9,wid,muni);
    dini_IntSet(file,"wslot9",wid); dini_IntSet(file,"wslotmuni9",muni);
    GetPlayerWeaponData(playerid,10,wid,muni);
    dini_IntSet(file,"wslot10",wid); dini_IntSet(file,"wslotmuni10",muni);
    GetPlayerWeaponData(playerid,11,wid,muni);
    dini_IntSet(file,"wslot11",wid); dini_IntSet(file,"wslotmuni11",muni);
    GetPlayerWeaponData(playerid,12,wid,muni);
    dini_IntSet(file,"wslot12",wid); dini_IntSet(file,"wslotmuni12",muni);

    So, ein Zitat aus meiner Datei:


    So, wenn man sich jetzt einloggt, bekommt man die halt wieder
    Spoiler anzeigen

    GivePlayerWeapon(playerid,dini_Int(file,"wslot1"),dini_Int(file,"wslotmuni1"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot2"),dini_Int(file,"wslotmuni2"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot3"),dini_Int(file,"wslotmuni3"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot4"),dini_Int(file,"wslotmuni4"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot5"),dini_Int(file,"wslotmuni5"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot6"),dini_Int(file,"wslotmuni6"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot8"),dini_Int(file,"wslotmuni8"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot9"),dini_Int(file,"wslotmuni9"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot10"),dini_Int(file,"wslotmuni10"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot11"),dini_Int(file,"wslotmuni11"));
    GivePlayerWeapon(playerid,dini_Int(file,"wslot12"),dini_Int(file,"wslotmuni12"));

    Und dann ist es eine Frage des Zufalls, ob man von der Waffe dann entweder die Anzahl der Munition, die auch in der Datei steht wiederbekommt, oder 65535 Schuss
    Ich kauf mir als Beispiel eine Tec9, mit 50 Schuss und gehe offline
    Ich komme wieder online, hab dann auch wieder die 50 Schuss von der Tec9 (in der Datei hat sich nix verändert), gehe jetzt wieder offline
    Komm wieder on - hab ich 65535 Schuss für die Tec9
    Weiß jemand um Rat?

  • dieses problem hatte ich auch und habe es nicht gefixxt bekommen ich glaube das ist ein algemeiner Samp bug
    weil an deinem code erkenne ich keinen fehler


    //edit oder ich würde noch mal nen timer machen der wenn man off geht nochmal alles abschpeichert

    RFT