Save weapon(s)
#2

pawn Код:
enum weapdat { WeaponID, WeaponAmmo }
new oldweapons[MAX_PLAYERS][13][weapdat];

stock GetOldWeapons(playerid)
{
    for (new i = 0; i < 13; i++) { GetPlayerWeaponData(playerid, i, oldweapons[playerid][i][WeaponID], oldweapons[playerid][i][WeaponAmmo]); }
}

stock SetOldWeapons(playerid)
{
    ResetPlayerWeapons(playerid);
    for (new i = 0; i < 13; i++) { GivePlayerWeapon(playerid, oldweapons[playerid][i][WeaponID], oldweapons[playerid][i][WeaponAmmo]); }
}
It's a good practice to use enums even for simple stuff that way someone who has never touched pawn would know the order of parameters without even having to reference the wiki.
Reply


Messages In This Thread
Save weapon(s) - by [..MonTaNa..] - 02.05.2013, 05:36
Re: Save weapon(s) - by Pottus - 02.05.2013, 05:46
Re: Save weapon(s) - by [..MonTaNa..] - 02.05.2013, 05:58
Re: Save weapon(s) - by Pottus - 02.05.2013, 05:59
Re: Save weapon(s) - by Pottus - 02.05.2013, 06:04
Re: Save weapon(s) - by [..MonTaNa..] - 02.05.2013, 06:17
Re: Save weapon(s) - by [..MonTaNa..] - 03.05.2013, 03:16

Forum Jump:


Users browsing this thread: 2 Guest(s)