Danke erstmal für die Hilfe, aber ich bekomm das so iwie nich hin.
Ich zeig euch ma wie ich das gemacht hab:
also
Im OnPlayerDisconnect:
public OnPlayerDisconnect(playerid)
{
GetPlayerWeaponData(playerid,0,PlayerPos[playerid][Weapon1],PlayerPos[playerid][Ammo1]);
GetPlayerWeaponData(playerid,1,PlayerPos[playerid][Weapon2],PlayerPos[playerid][Ammo2]);
GetPlayerWeaponData(playerid,2,PlayerPos[playerid][Weapon3],PlayerPos[playerid][Ammo3]);
GetPlayerWeaponData(playerid,3,PlayerPos[playerid][Weapon4],PlayerPos[playerid][Ammo4]);
GetPlayerWeaponData(playerid,4,PlayerPos[playerid][Weapon5],PlayerPos[playerid][Ammo5]);
GetPlayerWeaponData(playerid,5,PlayerPos[playerid][Weapon6],PlayerPos[playerid][Ammo6]);
GetPlayerWeaponData(playerid,6,PlayerPos[playerid][Weapon7],PlayerPos[playerid][Ammo7]);
GetPlayerWeaponData(playerid,7,PlayerPos[playerid][Weapon8],PlayerPos[playerid][Ammo8]);
GetPlayerWeaponData(playerid,8,PlayerPos[playerid][Weapon9],PlayerPos[playerid][Ammo9]);
GetPlayerWeaponData(playerid,9,PlayerPos[playerid][Weapon10],PlayerPos[playerid][Ammo10]);
GetPlayerWeaponData(playerid,10,PlayerPos[playerid][Weapon11],PlayerPos[playerid][Ammo11]);
GetPlayerWeaponData(playerid,11,PlayerPos[playerid][Weapon12],PlayerPos[playerid][Ammo12]);
GetPlayerWeaponData(playerid,12,PlayerPos[playerid][Weapon13],PlayerPos[playerid][Ammo13]);
SaveDisconnect(playerid);
return 1;
}
Für den SaveDisconnect habe ich:
public SaveDisconnect(playerid)
{
new string[256];
new Player[MAX_PLAYER_NAME];
//==============================
GetPlayerName(playerid,Player,sizeof(Player));
format(string,sizeof(string),"/Users/%s.ini",Player);
dini_IntSet(string,"Slot 1",PlayerPos[playerid][Weapon1]);
dini_IntSet(string,"Ammu 1",PlayerPos[playerid][Ammo1]);
dini_IntSet(string,"Slot 2",PlayerPos[playerid][Weapon2]);
dini_IntSet(string,"Ammu 2",PlayerPos[playerid][Ammo2]);
dini_IntSet(string,"Slot 3",PlayerPos[playerid][Weapon3]);
dini_IntSet(string,"Ammu 3",PlayerPos[playerid][Ammo3]);
dini_IntSet(string,"Slot 4",PlayerPos[playerid][Weapon4]);
dini_IntSet(string,"Ammu 4",PlayerPos[playerid][Ammo4]);
dini_IntSet(string,"Slot 5",PlayerPos[playerid][Weapon5]);
dini_IntSet(string,"Ammu 5",PlayerPos[playerid][Ammo5]);
dini_IntSet(string,"Slot 6",PlayerPos[playerid][Weapon6]);
dini_IntSet(string,"Ammu 6",PlayerPos[playerid][Ammo6]);
dini_IntSet(string,"Slot 7",PlayerPos[playerid][Weapon7]);
dini_IntSet(string,"Ammu 7",PlayerPos[playerid][Ammo7]);
dini_IntSet(string,"Slot 8",PlayerPos[playerid][Weapon8]);
dini_IntSet(string,"Ammu 8",PlayerPos[playerid][Ammo8]);
dini_IntSet(string,"Slot 9",PlayerPos[playerid][Weapon9]);
dini_IntSet(string,"Ammu 9",PlayerPos[playerid][Ammo9]);
dini_IntSet(string,"Slot 10",PlayerPos[playerid][Weapon10]);
dini_IntSet(string,"Ammu 10",PlayerPos[playerid][Ammo10]);
dini_IntSet(string,"Slot 11",PlayerPos[playerid][Weapon11]);
dini_IntSet(string,"Ammu 11",PlayerPos[playerid][Ammo11]);
dini_IntSet(string,"Slot 12",PlayerPos[playerid][Weapon12]);
dini_IntSet(string,"Ammu 12",PlayerPos[playerid][Ammo12]);
dini_IntSet(string,"Slot 13",PlayerPos[playerid][Weapon13]);
dini_IntSet(string,"Ammu 13",PlayerPos[playerid][Ammo13]);
return 1;
}
Beim Connecten:
public OnPlayerConnect(playerid)
{
LoadforSaveDisconnect(playerid);
return 1;
}
Und hier der LoadforSaveDisconnect:
public LoadforSaveDisconnect(playerid)
{
new string[256];
new Player[MAX_PLAYER_NAME];
//==============================
GetPlayerName(playerid,Player,sizeof(Player));
format(string,sizeof(string),"/Users/%s.ini",Player);
if(dini_Exists(string))
{
PlayerPos[playerid][Weapon1] = dini_Int(string,"Slot1");
PlayerPos[playerid][Ammo1] = dini_Int(string,"Ammu 1");
PlayerPos[playerid][Weapon2] = dini_Int(string,"Slot 2");
PlayerPos[playerid][Ammo2] = dini_Int(string,"Ammu 2");
PlayerPos[playerid][Weapon3] = dini_Int(string,"Slot 3");
PlayerPos[playerid][Ammo3] = dini_Int(string,"Ammu 3");
PlayerPos[playerid][Weapon4] = dini_Int(string,"Slot 4");
PlayerPos[playerid][Ammo4] = dini_Int(string,"Ammu 4");
PlayerPos[playerid][Weapon5] = dini_Int(string,"Slot 5");
PlayerPos[playerid][Ammo5] = dini_Int(string,"Ammu 5");
PlayerPos[playerid][Weapon6] = dini_Int(string,"Slot 6");
PlayerPos[playerid][Ammo6] = dini_Int(string,"Ammu 6");
PlayerPos[playerid][Weapon7] = dini_Int(string,"Slot 7");
PlayerPos[playerid][Ammo7] = dini_Int(string,"Ammu 7");
PlayerPos[playerid][Weapon8] = dini_Int(string,"Slot 8");
PlayerPos[playerid][Ammo8] = dini_Int(string,"Ammu 8");
PlayerPos[playerid][Weapon9] = dini_Int(string,"Slot 9");
PlayerPos[playerid][Ammo9] = dini_Int(string,"Ammu 9");
PlayerPos[playerid][Weapon10] = dini_Int(string,"Slot 10");
PlayerPos[playerid][Ammo10] = dini_Int(string,"Ammu 10");
PlayerPos[playerid][Weapon11] = dini_Int(string,"Slot 11");
PlayerPos[playerid][Ammo11] = dini_Int(string,"Ammu 11");
PlayerPos[playerid][Weapon12] = dini_Int(string,"Slot 12");
PlayerPos[playerid][Ammo12] = dini_Int(string,"Ammu 12");
PlayerPos[playerid][Weapon13] = dini_Int(string,"Slot 13");
PlayerPos[playerid][Ammo13] = dini_Int(string,"Ammu 13");
}
else
{
dini_Create(string);
dini_IntSet(string,"Slot 1",(0));
dini_IntSet(string,"Ammu 1",(0));
dini_IntSet(string,"Slot 2",(0));
dini_IntSet(string,"Ammu 2",(0));
dini_IntSet(string,"Slot 3",(0));
dini_IntSet(string,"Ammu 3",(0));
dini_IntSet(string,"Slot 4",(0));
dini_IntSet(string,"Ammu 4",(0));
dini_IntSet(string,"Slot 5",(0));
dini_IntSet(string,"Ammu 5",(0));
dini_IntSet(string,"Slot 6",(0));
dini_IntSet(string,"Ammu 6",(0));
dini_IntSet(string,"Slot 7",(0));
dini_IntSet(string,"Ammu 7",(0));
dini_IntSet(string,"Slot 8",(0));
dini_IntSet(string,"Ammu 8",(0));
dini_IntSet(string,"Slot 9",(0));
dini_IntSet(string,"Ammu 9",(0));
dini_IntSet(string,"Slot 10",(0));
dini_IntSet(string,"Ammu 10",(0));
dini_IntSet(string,"Slot 11",(0));
dini_IntSet(string,"Ammu 11",(0));
dini_IntSet(string,"Slot 12",(0));
dini_IntSet(string,"Ammu 12",(0));
dini_IntSet(string,"Slot 13",(0));
dini_IntSet(string,"Ammu 13",(0));
}
return 1;
}
Dann beim OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
Spawn(playerid);
return 1;
}
Und für den Spawn:
public Spawn(playerid)
{
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon1],PlayerPos[playerid][Ammo1]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon2],PlayerPos[playerid][Ammo2]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon3],PlayerPos[playerid][Ammo3]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon4],PlayerPos[playerid][Ammo4]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon5],PlayerPos[playerid][Ammo5]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon6],PlayerPos[playerid][Ammo6]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon7],PlayerPos[playerid][Ammo7]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon8],PlayerPos[playerid][Ammo8]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon9],PlayerPos[playerid][Ammo9]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon10],PlayerPos[playerid][Ammo10]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon11],PlayerPos[playerid][Ammo11]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon12],PlayerPos[playerid][Ammo12]);
GivePlayerWeapon(playerid,PlayerPos[playerid][Weapon13],PlayerPos[playerid][Ammo13]);
return 1;
}
Also für die etwas erfahreren hier müsste ich das denke ich mal ziemlich umständlich gemacht haben^^.
Aber ich wollte es zu anfang so machen das ich das auch kapiere.
Hab soviele publics (oder wie man da auch immer nennt) drin, weil ich da noch n Savespawner, skin und kampfstyle saver drin is.
Naja ich hoff das irgentjemand die Zeit findet, ein passendes GMX savedings zu machen.
Vielen dank an den der sich das vll mal angeschaut hat und ne lösung findet.