Code
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;
}
Alles anzeigen
Code
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;
}
Alles anzeigen
Wenn ich zb eine deagle in der hand habe und /saveguns mache und danach /dropguns ist alles so wies sein soll. wenn ich dann die waffen wieder haben will mache ich /getguns und kriege die deagle auch wieder aber wenn ich dann wieder /getguns mache kriege ich wieder ne deagle ...wie kann ich das so machen, dass wenn man einmal /getguns gemacht hatman dann keine waffen mehr kriegt