So the player picks up a weapon and places it on the truck, right?
First all of clearweaponscargo and magazinecargo of the truck.
and then you may do the following in a loop:
get player weapons array, get player magazines array.
compare these values with previous ones, if any decreases or increases check if player is quite close to truck. if increases, you may consider the player took the new weapon of magazine from the truck, if decreases, just the opposite.