12.09.2012, 18:23
Olб, estou com problema no meu sistema de salvar armas, alguйm poderia me ajudar?
Ele estб salvando, mas o problema estб sendo na hora de carregar a arma, desde jб obrigado.
Ele estб salvando, mas o problema estб sendo na hora de carregar a arma, desde jб obrigado.
pawn Код:
stock ResetWeapons(playerid)
{
ResetPlayerWeapons(playerid);
}
stock RemoveWeapons(playerid)
{
for(new i = 0; i < 13; i++)
{
GetWeapons[playerid][i][0] = 0;
GetWeapons[playerid][i][1] = 0;
}
ResetPlayerWeapons(playerid);
}
stock LoadWeapons(playerid)
{
KillTimer(TimerReceive[playerid][0]);
ReceivingWeapon[playerid] = 1;
ResetWeapons(playerid);
for(new i = 0; i < 13; i++)
{
if(GetWeapons[playerid][i][0] != 0 && GetWeapons[playerid][i][1] != 0)
GivePlayerWeapon(playerid, GetWeapons[playerid][i][0], GetWeapons[playerid][i][1]);
}
SaveWeapons(playerid);
TimerReceive[playerid][0] = SetTimerEx("ZerarRecebendoArma", 10000, 0, "d", playerid);
}
stock SaveWeapons(playerid)
{
for(new i = 0; i < 13; i++)
{
new w = 0, a = 0;
GetPlayerWeaponData(playerid, i, w, a);
if(a <= 0)
{
GetWeapons[playerid][i][0] = 0;
GetWeapons[playerid][i][1] = 0;
}
else if(a < 0xFFFF || i < 2)
{
GetWeapons[playerid][i][0] = w;
GetWeapons[playerid][i][1] = a;
}
}
}