09.10.2010, 14:15
Okey, I made the code for you. Was easier that I thought. 
Note: I've tested the code, and the weapon ammo is not always correct. I think that there is a mistake in the function "GetPlayerWeaponData".
Just test the code yourself, and give me your opinion.
Greetz.

pawn Код:
new PlayerWeaponDetails[MAX_PLAYERS][13][2];
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER /*|| newstate == PLAYER_STATE_PASSENGER*/) //Just remove the ''/*'' ''*/'' and it works for Passenger too.
{
for (new i = 0; i < 13; i++) PlayerWeaponDetails[playerid][i][0]=0, PlayerWeaponDetails[playerid][i][1]=0;
for (new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, PlayerWeaponDetails[playerid][i][0], PlayerWeaponDetails[playerid][i][1]);
ResetPlayerWeapons(playerid);
}
if(oldstate == PLAYER_STATE_DRIVER /*|| newstate == PLAYER_STATE_PASSENGER*/) //Same here.
{
if(newstate == PLAYER_STATE_ONFOOT)
{
for (new i = 0; i < 13; i++) GivePlayerWeapon(playerid, PlayerWeaponDetails[playerid][i][0], PlayerWeaponDetails[playerid][i][1]);
}
}
return 1;
}
Just test the code yourself, and give me your opinion.
Greetz.
