Thanks, I'll see if I can figure it out.Packer898 said:Object referance not set to an instance of object.
team = pm.FindItemOnLayer( Layer.TwoHanded ).Hue;
private void AddPlayers()
{
int Team1, Team2, Team3, Team4;
Team1 = Team2 = Team3 = Team4 = 0;
int team = -1;
foreach( PlayerMobile pm in m_PBGI.Players )
{
Item item = pm.FindItemOnLayer( Layer.TwoHanded );
if( item != null )
team = item.Hue;
switch( team )
{
case 3:
{
if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
AddLabel( 25, 95+Team1*20, 3, pm.Name );
else
AddLabel( 25, 95+Team1*20, 1153, pm.Name );
Team1 += 1;
break;
}
case 38:
{
if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
AddLabel( 172, 95+Team2*20, 38, pm.Name );
else
AddLabel( 172, 95+Team2*20, 1153, pm.Name );
Team2 += 1;
break;
}
case 68:
{
if( m_PBGI.Teams > 2 )
{
if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
AddLabel( 318, 95+Team3*20, 68, pm.Name );
else
AddLabel( 318, 95+Team3*20, 1153, pm.Name );
Team3 += 1;
}
break;
}
case 53:
{
if( m_PBGI.Teams > 3 )
{
if( pm.ChestArmor != null && pm.ChestArmor.Hue == team )
AddLabel( 463, 95+Team4*20, 53, pm.Name );
else
AddLabel( 463, 95+Team4*20, 1153, pm.Name );
Team4 += 1;
}
break;
}
default: break;
}
}
AddLabel(44, 70, 3, "Team 1 - " + Team1.ToString());
AddLabel(188, 70, 38, "Team 2 - " + Team2.ToString());
if( m_PBGI.Teams > 2 )
AddLabel(334, 70, 68, "Team 3 - " + Team3.ToString());
if( m_PBGI.Teams > 3 )
AddLabel(478, 70, 53, "Team 4 - " + Team4.ToString());
}
hehe, first time I saw someone using Czech version of the .Net on these forums. Just wanted to say that .A_Li_N said:Could you translate that into english?
A_Li_N said:The only thing I can think of that could cause that error would be this line:
Code:team = pm.FindItemOnLayer( Layer.TwoHanded ).Hue;
Try changing it to this: (Replace the entire AddPlayers() method)
Code:private void AddPlayers() { int Team1, Team2, Team3, Team4; Team1 = Team2 = Team3 = Team4 = 0; int team = -1; foreach( PlayerMobile pm in m_PBGI.Players ) { Item item = pm.FindItemOnLayer( Layer.TwoHanded ); if( item != null ) team = item.Hue; switch( team ) { case 3: { if( pm.ChestArmor != null && pm.ChestArmor.Hue == team ) AddLabel( 25, 95+Team1*20, 3, pm.Name ); else AddLabel( 25, 95+Team1*20, 1153, pm.Name ); Team1 += 1; break; } case 38: { if( pm.ChestArmor != null && pm.ChestArmor.Hue == team ) AddLabel( 172, 95+Team2*20, 38, pm.Name ); else AddLabel( 172, 95+Team2*20, 1153, pm.Name ); Team2 += 1; break; } case 68: { if( m_PBGI.Teams > 2 ) { if( pm.ChestArmor != null && pm.ChestArmor.Hue == team ) AddLabel( 318, 95+Team3*20, 68, pm.Name ); else AddLabel( 318, 95+Team3*20, 1153, pm.Name ); Team3 += 1; } break; } case 53: { if( m_PBGI.Teams > 3 ) { if( pm.ChestArmor != null && pm.ChestArmor.Hue == team ) AddLabel( 463, 95+Team4*20, 53, pm.Name ); else AddLabel( 463, 95+Team4*20, 1153, pm.Name ); Team4 += 1; } break; } default: break; } } AddLabel(44, 70, 3, "Team 1 - " + Team1.ToString()); AddLabel(188, 70, 38, "Team 2 - " + Team2.ToString()); if( m_PBGI.Teams > 2 ) AddLabel(334, 70, 68, "Team 3 - " + Team3.ToString()); if( m_PBGI.Teams > 3 ) AddLabel(478, 70, 53, "Team 4 - " + Team4.ToString()); }
Give that a try and see if you crash again. If you are able to reproduce the crash, do so in debug mode to give me a better understanding where the crash occurs.
Packer898 said:Object referance not set to an instance of object.
arul said:hehe, first time I saw someone using Czech version of the .Net on these forums. Just wanted to say that .
Making items invisable could make their backpacks too full when event items are added right? Not a good idea. And I have told people this many times...making the chip activate with a gate is a waste of time. What if a person has to logout in the middle of an event and logs back in when the event is over? The teleporter would be missing. I strip all skills and give 5 stat points which forces people into going to the bank and using their chip. It also helps to exit them at brit bank or bucs den depending on their amount of kills.I think instead of moving all the players stuff to their banks, why not just set all the stuff in the parks visible = false? and make it unequip there armor, and set its visible false, and then when the game is over, reequip the armor, and set visible true, and set visible true for all the stuff in their pack, and then script a teleporter that doesnt let players go through if they have a memory chip in their bank [forcing them to click it] and then you can make players end up in a closed room, without a way to get out unless they click thier memory chip. just a suggestion.
Lucid Nagual said:Making items invisable could make their backpacks too full when event items are added right?
Lucid Nagual said:And I have told people this many times...making the chip activate with a gate is a waste of time. What if a person has to logout in the middle of an event and logs back in when the event is over? The teleporter would be missing.
My events give event gear. That added gear with the weight of their items can cause issues. It can even cause issues if a players backpack is near full and you add paintballs to the players backpack. Sorry but i still say that is not a smart idea.Quote:
Originally Posted by Lucid Nagual
Making items invisable could make their backpacks too full when event items are added right?
How would it do that? You takling about when the prizes are givin out? You could make it so the prize's are added to their banks (much safer for the players) and the players that I know *HATE* having to put their stuff into there backpacks after the paintball event is over.
Quote:
Originally Posted by Lucid Nagual
And I have told people this many times...making the chip activate with a gate is a waste of time. What if a person has to logout in the middle of an event and logs back in when the event is over? The teleporter would be missing.
The teleporters wouldn't be missing because who's gonna delete them? I never said I would be removing the teleporters after the event is over, I only said make the teleporters search for a memory chip in the players bank, and then when they still have it in their bank, the teleporter doesnt let them through, and could even move the chip from their bank to their backpack. I'm just suggesting idea's that could improve the paintball script, and I don't see how these idea's are bad. They seem pretty reasonable, and doable, to me.
It would be much better to use Central Memory to save your Race info. Then there would be no need for orbs in the backpack.i was going to ask if there was a way to keep from removing immovable items from pack (seeing as i use a race system that places invisible stones in packs) but seeing as it will sooner or later be updated to the Completly custom system, will it be handled in that?
either way, thanks
I'll keep that in mind for the update, whenever that comes alongPyro-Tech said:i was going to ask if there was a way to keep from removing immovable items from pack (seeing as i use a race system that places invisible stones in packs) but seeing as it will sooner or later be updated to the Completly custom system, will it be handled in that?
either way, thanks
else
{
Players.Add( from );
ArrayList ItemsToMove = new ArrayList();
Backpack itemsPack = new Backpack();
itemsPack.Hue = 1;
itemsPack.Name = "Items from PaintBallGame";
BankBox bankBox = from.BankBox;
foreach( Item item in from.Items )
if( item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack )
ItemsToMove.Add( item );
foreach( Item item in from.Backpack.Items )
ItemsToMove.Add( item );
foreach( Item item in ItemsToMove )
itemsPack.AddItem( item );
bankBox.AddItem( itemsPack );
bankBox.AddItem( new PBPlayerStorage( from ) );
AddToTeam( from );
}
else
{
Players.Add( from );
ArrayList ItemsToMove = new ArrayList();
Backpack itemsPack = new Backpack();
itemsPack.Hue = 1;
itemsPack.Name = "Items from PaintBallGame";
BankBox bankBox = from.BankBox;
foreach( Item item in from.Items )
if( item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack )
ItemsToMove.Add( item );
[color=red] foreach( Item item in from.Backpack.Items )
{
if( !item.Movable || !item.Visible [color=blue]/*|| item is YourTypeOfItemToSkip*/ )[/color]
continue;
ItemsToMove.Add( item );
}[/color]
foreach( Item item in ItemsToMove )
itemsPack.AddItem( item );
bankBox.AddItem( itemsPack );
bankBox.AddItem( new PBPlayerStorage( from ) );
AddToTeam( from );
}