Jo, die Waffen werden nicht gespeichert, ich muss mir immer neue Waffen holen.
Warum ?
OnPlayerSpawn
LadeWaffen(playerid);
OnPlayerConnect
LadeWaffen(playerid);
OnPlayerDisConnect
SpeicherWaffen(playerid);
Und nun die Stocks
stock LadeWaffen(playerid)
{
new pname[MAX_PLAYER_NAME];
if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
if(!udb_Exists(pname)) udb_Create(pname, "");
for(new wep[8], amm[6], i; i < 13; i++)
{
format(amm, sizeof amm, "Munition%d", i);
format(wep, sizeof wep, "Waffe%d", i);
GivePlayerWeapon(playerid, dUserINT(pname).(wep), dUserINT(pname).(amm));
}
return true;
}
stock SpeicherWaffen(playerid)
{
new pname[MAX_PLAYER_NAME];
if(!GetPlayerName(playerid, pname, MAX_PLAYER_NAME)) return false;
if(!udb_Exists(pname)) udb_Create(pname, "");
for(new wep[8], amm[6], i, cwep, camm; i < 13; i++)
{
format(amm, sizeof amm, "Munition%d", i);
format(wep, sizeof wep, "Waffe%d", i);
GetPlayerWeaponData(playerid, i, cwep, camm);
dUserSetINT(pname).(amm, camm);
dUserSetINT(pname).(wep, cwep);
}
return true;
}