if(strcmp(cmd, "/saveguns", true) == 0)
{
for(new slot=0; slot<13; slot++)
{
GetPlayerWeaponData(playerid,slot,SavePlayerWeapons[playerid][slot],SavePlayerAmmo[playerid][slot]);
}
return 1;
}
if(strcmp(cmd, "/getguns", true) == 0)
{
for(new slot=0; slot<13; slot++)
{
if(SavePlayerWeapons[playerid][slot] != -1 && SavePlayerAmmo[playerid][slot] != -1)
{
GivePlayerWeapon(playerid,SavePlayerWeapons[playerid][slot],SavePlayerAmmo[playerid][slot]);
}
}
return 1;
}
stock WaffenSpeichern(playerid)
{
new waffe,ammo,save[40],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Waffen/%s.ini",name);
//____________________________________Waffen Speichern____________________________________
GetPlayerWeaponData(playerid,0,waffe,ammo);
dini_IntSet(save,"waslot",waffe);
dini_IntSet(save,"amslot",ammo);
GetPlayerWeaponData(playerid,1,waffe,ammo);
dini_IntSet(save,"waslot1",waffe);
dini_IntSet(save,"amslot1",ammo);
GetPlayerWeaponData(playerid,2,waffe,ammo);
dini_IntSet(save,"waslot2",waffe);
dini_IntSet(save,"amslot2",ammo);
GetPlayerWeaponData(playerid,3,waffe,ammo);
dini_IntSet(save,"waslot3",waffe);
dini_IntSet(save,"amslot3",ammo);
GetPlayerWeaponData(playerid,4,waffe,ammo);
dini_IntSet(save,"waslot4",waffe);
dini_IntSet(save,"amslot4",ammo);
GetPlayerWeaponData(playerid,5,waffe,ammo);
dini_IntSet(save,"waslot5",waffe);
dini_IntSet(save,"amslot5",ammo);
GetPlayerWeaponData(playerid,6,waffe,ammo);
dini_IntSet(save,"waslot6",waffe);
dini_IntSet(save,"amslot6",ammo);
return 0;
}
stock WaffenLaden(playerid)
{
new save[40],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"/Waffen/%s.ini",name);
//____________________________________Waffen Laden____________________________________
wInfo[playerid][SavePlayerWeapons] =dini_Int(save,"waslot");
wInfo[playerid][SavePlayerWeapons1] =dini_Int(save,"waslot1");
wInfo[playerid][SavePlayerWeapons2] =dini_Int(save,"waslot2");
wInfo[playerid][SavePlayerWeapons3] =dini_Int(save,"waslot3");
wInfo[playerid][SavePlayerWeapons4] =dini_Int(save,"waslot4");
wInfo[playerid][SavePlayerWeapons5] =dini_Int(save,"waslot5");
wInfo[playerid][SavePlayerWeapons6] =dini_Int(save,"waslot6");
wInfo[playerid][SavePlayerAmmo] =dini_Int(save,"amslot");
wInfo[playerid][SavePlayerAmmo2] =dini_Int(save,"amslot1");
wInfo[playerid][SavePlayerAmmo3] =dini_Int(save,"amslot2");
wInfo[playerid][SavePlayerAmmo4] =dini_Int(save,"amslot3");
wInfo[playerid][SavePlayerAmmo5] =dini_Int(save,"amslot4");
wInfo[playerid][SavePlayerAmmo6] =dini_Int(save,"amslot5");
wInfo[playerid][SavePlayerAmmo7] =dini_Int(save,"amslot6");
return 0;
}
Problem:
Ich hab' z.B. 'ne Deagle in der Hand mit 200 Munition. Wenn ich dann /saveguns machen speichert er das. Wenn ich dann /dropguns mache und dann wieder /getguns krieg ich zwar wieder meine Deagle mit 200 Schuss, aber, wenn ich den Befehl (/getguns) erneut schreibe bekomme ich wieder 'ne Deagle mit 200 Schuss...Wie kann ich das beheben, dass man beim /getguns die Waffen kriegt und danach nicht mehr?