Author Topic: Coding Lingo  (Read 1957 times)

1)
Put them in a package

2)
include a parent::onMount(%this,%obj,%slot); and parent::onUnMount(%this,%obj,%slot); at the end of each function.

Er, and the most important problem is the only crosshair you'll be changing is your own. Any time someone else mounts a weapon it will change your crosshair only.

Er, and the most important problem is the only crosshair you'll be changing is your own. Any time someone else mounts a weapon it will change your crosshair only.

Mm..

You'll probably have to make it send commands to the client then and make a client-sided part of the mod.

1)
Put them in a package

2)
include a parent::onMount(%this,%obj,%slot); and parent::onUnMount(%this,%obj,%slot); at the end of each function.

It's in a client package. It's to change only my crosshairs because others don't have the crosshair. The sniper rifle, gun, and shotgun work just fine. My problem is that the same thing for the Gun Akimbo and Rocket Launcher don't work the same.

It's to change only my crosshairs because others don't have the crosshair.
So what you're saying is that you haven't tried this on another server.

ShapeBaseImageData::onMount is a server sided function.
crosshair is a client sided object.

This isn't going to work out well.

So what you're saying is that you haven't tried this on another server.

ShapeBaseImageData::onMount is a server sided function.
crosshair is a client sided object.

This isn't going to work out well.

You could make a client command and testing if %this has your b-

Oh, I see what you mean.

So what you're saying is that you haven't tried this on another server.

ShapeBaseImageData::onMount is a server sided function.
crosshair is a client sided object.

This isn't going to work out well.

It works for 3/5 weapons in the script.

Testing done.

Nothing happens on other servers. :/

I'd still like to know what the problem is for future scripts.

ShapeBaseImageData::onMount is a server sided function.
That function is only called on the server. When you join another you are a client and do not get that call-back.

So this will only work on my servers, correct?

If your server is non-dedicated and anybody else joins it and uses the Gun etc., your crosshair will change instead of theirs.

If your server is dedicated it may just not work for anyone (at least), cause console errors or crash the server when somebody uses any of those weapons.

If your server is non-dedicated and anybody else joins it and uses the Gun etc., your crosshair will change instead of theirs.

If your server is dedicated it may just not work for anyone (at least), cause console errors or crash the server when somebody uses any of those weapons.

Can I make it only client sided? That was my original goal.

Switching weapons does (I believe) send messages to the client.

If you can hook into those you might be able to.

Hao2get Standard_Player.cs?

I know I need to make it manually, I just need the command to write out the file.

Bump.

I need to know this so that I have all of the values.

Create a client add-on that accepts commands from the server.

An example of a client.cs file:
Code: [Select]
function clientcmdChangeCrosshair(%client,%crosshair)
{
if(%crosshair $= "")
{
echo("Inavlid Crosshair");
return;
}

if(isFile(%crosshair))
crosshair.setBitmap(%crosshair);
else
return;

echo("Successfully changed crosshair to: " @ %crosshair);
}

Now when you do unMount, make sure you add commandToClient(%client, 'ChangeCrosshair', 0, %crosshair);

commandToClient and commandToServer are important functions for this to work.

commandToClient executes clientCmd on the target client.

commandToServer executes serverCmd on the server.
« Last Edit: March 23, 2010, 01:55:39 PM by Jaydee »