10.12.2012, 17:21
Hello. I trying to make script that gets players weapons data on player death and on player spawn give him his weapons which was before death. But now when I try to get weapons in OnPlayerDeath callback, it can't get data because player is dead and weapons are removed. So how else I can get player weapon data before he die?
Also tried OnPlayerUpdate, but when he die it calls OnPlayerUpdate callback and updates weapon data to nothing.
Here is my code OnPlayerDeath:
And OnPlayerSpawn:
Also tried OnPlayerUpdate, but when he die it calls OnPlayerUpdate callback and updates weapon data to nothing.
Here is my code OnPlayerDeath:
Code:
for(new tmp=0; tmp<12; tmp++) GetPlayerWeaponData(playerid, tmp, weaponsbeforedie[0][tmp], weaponsbeforedie[1][tmp]);
Code:
for(new tmp=0; tmp<12; tmp++) GivePlayerWeapon(playerid, wepsbeforedie[0][tmp], wepsbeforedie[1][tmp]);