Give this a try. It should do the trick. The posted script was a bit confusing to read(all ints, objects and locs used an "x" naming convention. Should do something specific for each one to recognize what it is. Most people use "o" for object, "l" for location and "n" or "i" for integers.) so I altered for the purpose of this post. Also took out a bit of redundancy. You were defining the player who died twice.
#include "color_include"
void main()
{
//Get the player
object oPC = GetLastPlayerDied();
//Make sure the object that died is actually a player character. If not,
//reutrn.
if (!GetIsPC(oPC)) return;
int nCount, nGold;
object oCorpse, oItem;
location lLoc = GetLocation(oPC);
//Create corpse at player's feet
oCorpse = CreateObject(OBJECT_TYPE_PLACEABLE,"sc_corpse",lLoc);
//Drop equipment on corpse
for (nCount = 0; nCount < NUM_INVENTORY_SLOTS; nCount++)
{
//Skip creature items
if(nCount != INVENTORY_SLOT_CARMOUR &&
nCount != INVENTORY_SLOT_CWEAPON_B &&
nCount != INVENTORY_SLOT_CWEAPON_L &&
nCount != INVENTORY_SLOT_CWEAPON_R)
{
oItem = GetItemInSlot(nCount, oPC);
if(GetIsObjectValid(oItem))
{
AssignCommand(oCorpse,ActionTakeItem(oItem,oPC));
}
}
}
/////Now drop player's gold.//////
//nGold = (GetGold(oPC));
//AssignCommand(oCorpse, TakeGoldFromCreature(nGold,oPC,TRUE));
//CreateItemOnObject ("nw_it_gold001", oCorpse, nGold);
//////////////////////////////////
DelayCommand(2.0, FloatingTextStringOnCreature(PALEBLUE+"You have died. You're belongings have been dropped on the floor.", oPC));
DelayCommand(4.0, FloatingTextStringOnCreature(PALEBLUE+"you can either respawn or wait to bo rescued from another player.", oPC));
DelayCommand(8.0, PopUpGUIPanel(oPC,GUI_PANEL_PLAYER_DEATH));
}
Hope that works for ya. Good luck.
Modifié par GhostOfGod, 30 octobre 2010 - 05:03 .