Hallo, ich habe ein "kleines" Problemundzwar, ich habe etwas, dass die Waffen beim Disconnecten abgespeichert werden, das sieht so aus:
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:
ZitatAlles anzeigenSpoiler anzeigen wslot1=0
wslotmuni1=0
wslot2=0
wslotmuni2=0
wslot3=0
wslotmuni3=0
wslot4=32
wslotmuni4=23
wslot5=31
wslotmuni5=16
wslot6=0
wslotmuni6=0
wslot8=0
wslotmuni8=0
wslot9=0
wslotmuni9=0
wslot10=0
wslotmuni10=0
wslot11=0
wslotmuni11=0
wslot12=0
wslotmuni12=0
So, wenn man sich jetzt einloggt, bekommt man die halt wieder
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?