SA-MP Forums Archive
System save/load weapons - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: System save/load weapons (/showthread.php?tid=376394)



System save/load weapons - [BR]Michael - 10.09.2012

Hello, I'm having some problems on my system to save and load my weapon system, it took a change and still not working properly, could help me? Sorry my bad english, and now thanks.

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;
        }
    }
}



Re: System save/load weapons - [BR]Michael - 10.09.2012

Up :/


Re: System save/load weapons - CROSS_Hunter - 10.09.2012

whats the problem?

1. dont bump your posts
2. did you call those stock functions in any call back?
3. wheres your saving system?
4. dont use stocks.. use enumerators to save / load the weapons and a saving system as well


Re: System save/load weapons - [BR]Michael - 10.09.2012

Quote:
Originally Posted by CROSS_Hunter
Посмотреть сообщение
whats the problem?

1. dont bump your posts
2. did you call those stock functions in any call back?
3. wheres your saving system?
4. dont use stocks.. use enumerators to save / load the weapons and a saving system as well
Hello, I'm managing to save the weapons, but they are not loading ...


Re: System save/load weapons - zT KiNgKoNg - 10.09.2012

Quote:
Originally Posted by CROSS_Hunter
Посмотреть сообщение
whats the problem?

1. dont bump your posts
2. did you call those stock functions in any call back?
3. wheres your saving system?
4. dont use stocks.. use enumerators to save / load the weapons and a saving system as well
So fucking true


Re: System save/load weapons - [BR]Michael - 14.09.2012

up ;x