Suggestion: Don't drop the gold, create an item.
Create a bag of holding(varriant) and store the amount of gold the player had as a local INT on the bag, then destroy players gold.
And give that much gold when the bag is acquired, and destroy the bag.
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
object oPC;
object oItem;
//SendMessageToPC(GetFirstPC(),IntToString(nEvent));
if (nEvent == X2_ITEM_EVENT_ACQUIRE)
{
oPC = GetModuleItemAcquiredBy();
oItem = GetModuleItemAcquired();
if(!GetIsPC(oPC)) return;
int iGPValue = GetLocalInt(oItem, "Bag4Gold"); //Sorry, a "cash for gold" joke was required.
GiveGoldToCreature(oPC, iGPValue );
DestroyObject(oItem);
}
}
Profit.