Jump to content

Recommended Posts

Posted

Hi all,

Today I pose an interesting problem. I've written up some code for a gun and on SSP it works flawlessly. But for some reason, when using it in SMP the onItemRightClick and onUpdate methods don't go threw and the item doesn't work. Any ideas?

 

 

  Reveal hidden contents

 

There isn't an error, it just doesn't work.

Posted
  On 6/18/2013 at 7:00 AM, blfngl said:

public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3)
{
	if (!var2.isRemote && rounds > 0)
	{

public void onUpdate(ItemStack par1ItemStack, World var2, Entity par3Entity, int par4, boolean par5) 
{
	EntityPlayer var3 = (EntityPlayer)par3Entity;

	if (!var2.isRemote && var3.inventory.hasItem(ammoType.itemID) && rounds<clipSize && Fallout.isReloading && !reloading)
	{

The !isRemote would be my first guess.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted
  On 6/18/2013 at 2:29 PM, ObsequiousNewt said:

  Quote

public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3)
{
	if (!var2.isRemote && rounds > 0)
	{

public void onUpdate(ItemStack par1ItemStack, World var2, Entity par3Entity, int par4, boolean par5) 
{
	EntityPlayer var3 = (EntityPlayer)par3Entity;

	if (!var2.isRemote && var3.inventory.hasItem(ammoType.itemID) && rounds<clipSize && Fallout.isReloading && !reloading)
	{

The !isRemote would be my first guess.

I was testing it and apparently the rounds value isn't changing properly...any ideas?
Posted
  On 6/18/2013 at 4:27 PM, blfngl said:

  Quote

  Quote

public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3)
{
	if (!var2.isRemote && rounds > 0)
	{

public void onUpdate(ItemStack par1ItemStack, World var2, Entity par3Entity, int par4, boolean par5) 
{
	EntityPlayer var3 = (EntityPlayer)par3Entity;

	if (!var2.isRemote && var3.inventory.hasItem(ammoType.itemID) && rounds<clipSize && Fallout.isReloading && !reloading)
	{

The !isRemote would be my first guess.

I was testing it and apparently the rounds value isn't changing properly...any ideas?

In both client and server?

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted
  On 6/18/2013 at 7:09 PM, ObsequiousNewt said:

  Quote

  Quote

  Quote

public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3)
{
	if (!var2.isRemote && rounds > 0)
	{

public void onUpdate(ItemStack par1ItemStack, World var2, Entity par3Entity, int par4, boolean par5) 
{
	EntityPlayer var3 = (EntityPlayer)par3Entity;

	if (!var2.isRemote && var3.inventory.hasItem(ammoType.itemID) && rounds<clipSize && Fallout.isReloading && !reloading)
	{

The !isRemote would be my first guess.

I was testing it and apparently the rounds value isn't changing properly...any ideas?

In both client and server?

It's acting very strangely. When I remove the !var2.isRemote completely, when firing on a server the rounds variable never changes and on the client no audio plays. If the !var2.isRemote is there, then nothing happens on the server but the item works perfectly in SSP. If it's var2.isRemote instead, no audio is played on the client and the audio spazzes out on the server.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.