Full Version : Kills and Deaths
xmlspawner >>Scripting Support >>Kills and Deaths
<< Prev | Next >>
ArteGordon- 04-27-2006
That is because of the order in which you add them in the method.
The player name is added in the base.AddNameProperties call. If you add your other list entries before that, then it will appear before it in the list. You need to post the entire AddNameProperties method otherwise there is no way of knowing what you are doing wrong.
you also add this twice
list.Add(1060660, "Deaths\t0");
list.Add(1060661, "Deaths\t0");
kobra- 04-27-2006
Alright here is what i think u need

CODE
public override void AddNameProperties( ObjectPropertyList list ) { if (AccessLevel == AccessLevel.Player) { if (m_Kills > 0)
list.Add(1060660, "Kills\t{0}", m_Kills);
else
list.Add(1060660, "Deaths\t0");
if (m_Deaths > 0)
list.Add(1060661, "Deaths\t{0}", m_Deaths);
else
list.Add(1060661, "Deaths\t0");
}
base.AddNameProperties( list );
if ( PvpPointSystem.EnablePointSystem == true && PvpPointSystem.EnableRankSystem == true )
{
if ( m_PvpRank != null )
{
if ( AccessLevel == AccessLevel.Player )
list.Add( 1060660, "Pvp Rank\t{0}", m_PvpRank );
else if ( PvpPointSystem.EnableStaffRank == true )
list.Add( 1060660, "Pvp Rank\t{0}", m_PvpRank );
}
else
{
if ( AccessLevel == AccessLevel.Player )
list.Add( 1060660, "Pvp Rank\tNewbie" );
else if ( PvpPointSystem.EnableStaffRank == true )
list.Add( 1060660, "Pvp Rank\tNewbie" );
}
}
}
public override void GetProperties( ObjectPropertyList list )
{

i am just unsure how to delete the list.Add(1060660, "Deaths\t0");
and order the stuff in the right way
thanks a lot !!
ArteGordon- 04-27-2006
just switch the order and edit the text.

QUOTE
public override void AddNameProperties( ObjectPropertyList list ) { base.AddNameProperties( list ); if (AccessLevel == AccessLevel.Player) {
if (m_Kills > 0)
list.Add(1060660, "Kills\t{0}", m_Kills);
else
list.Add(1060660, "Kills\t0");
if (m_Deaths > 0)
list.Add(1060661, "Deaths\t{0}", m_Deaths);
else
list.Add(1060661, "Deaths\t0");
}

kobra- 04-27-2006
ok first of all i did what u said and no errors and it starts up fine. the kills/deaths are in right spot (thank god) HOWEVER the deaths show and the kills dont. I changed the kills name to kills2 and now it shows up on [props but it still doesnt show up underneath player, only deaths does (attached pic below)
here is my code of that one part and updated playermobile is attached as well.
***COuldnt attach picture but you know what it looks like - everything is rite its just that Kills dont show***(Deaths show!)
Thanks Again!!!
kobra- 04-27-2006

CODE
public override void AddNameProperties( ObjectPropertyList list ) { base.AddNameProperties( list ); if (AccessLevel == AccessLevel.Player) {
if (m_Kills2 > 0)
list.Add(1060660, "Kills2\t{0}", m_Kills2);
else
list.Add(1060660, "Kills2\t0");
if (m_Deaths > 0)
list.Add(1060661, "Deaths\t{0}", m_Deaths);
else
list.Add(1060661, "Deaths\t0");
}

there is code sory forgot to add
ArteGordon- 04-27-2006
again, you are using the same cliloc multiple times.
list.Add( 1060660, "Pvp Rank\t{0}", m_PvpRank );
list.Add(1060660, "Kills2\t{0}", m_Kills2);
you cannot do this. You must use different clilocs.
kobra- 04-27-2006
AWESOME!!! thank you so much it works great i really appriciate all the time you took to help me!!!
Just one more question - down below is a attached picture of how it currently looks, i just wanted to know if it is possible to get the Kills and Deaths going side-by-side instead of up and down?
like
Kills: 10 Deaths:1
if it is possbiel can u tell me or show me how it would be super great!
ArteGordon- 04-27-2006
no, that is not possible
kobra- 04-27-2006
Again - i really really thank you for all your help, time, patience, and kindess. You spent a lot of time just to help me and get me satisfied i really Greatly appriciate that. sir. Much apppriciated, have a good day
Lord Mashadow- 05-15-2006
thank u for everything guys but a question , is there a way shows kills and deaths like this
Kills 5 / Deaths 2 under of players name ???
help please
ArteGordon- 05-16-2006
you could do something like this in your playermobile.cs

QUOTE
public override void AddNameProperties( ObjectPropertyList list ) { base.AddNameProperties( list ); list.Add(1070722, "Kills {0} / Deaths {1}", Kills, Deaths); }

of course, you would have to have the properties Kills and Deaths defined the way you wanted.
Lord Mashadow- 05-16-2006
You are Greatttt thank u sir , i always want this but couldnt do it in my server now its working crazy ty ty ty ty ty