Save weapon(s)
#1

.....
Reply
#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
#3

....
Reply
#4

Woops I derped check the stocks now
Reply
#5

Ok well, I think you'll need to change some stuff about that to get it to work correctly. For one I wouldn't do this
PayPlayerInArea(i, 1995.5, 1518.0, 2006.0, 1569.0, 100); I would use the streamer plugin and add a dynamic area then check if the player is in that area during the loop. Then for GetOldWeapons() and SetOldWeapons() would be called in these callbacks respectively OnPlayerEnterDynamicArea() and OnPlayerLeaveDynamicArea().
Reply
#6

.....
Reply
#7

Removed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)