Game Development Community

Image change only on server....

by CIMO · in General Discussion · 06/07/2006 (10:36 am) · 5 replies

I use this script in my M4A1.CS file "starter.fps/server/scripts/...."

function M4A1Image::onNoAmmo(%this, %obj, %slot)
{
	GUICrossHair.Visible = "0";
	GUICrossHairVuoto.Visible = "1";
}

function M4A1Image::onReady(%this, %obj, %slot)
{
	if ($ZoomOn == false)
	{
		GUICrossHair.Visible = "1";
		GUICrossHairVuoto.Visible = "0";
	}
	else
	{
		GUICrossHair.Visible = "0";
		GUICrossHairVuoto.Visible = "0";
	}
}

I test this in signle player and all Ok =D
But if use this with -> client and server <- .... =( sob =( ... have a problem...
If the "client" not have AMMO call the "onNoAmmo" function" but the image change on server?!?!?!!
The server not have a problem....but the client ago to change the images to the server
HELP THANKS!!! =D

#1
06/07/2006 (10:38 am)
Wrong forum.

This works for me, other than that I'm afraid I don't understand what you're seeing.

Edit: Oh yeah now I see what you're trying to do. Go read the tutorials you got asked to read last time you posted with the same problem. You're basically asking the server to switch GUI and it doesn't have a GUI.
#2
06/07/2006 (10:43 am)
What? I have not understood what you want to say.....
#3
06/07/2006 (11:13 am)
Cimo, this is pretty similar to the issue we covered here.
#4
06/07/2006 (12:07 pm)
Therefore I insert this in "starter.fps\client\scripts\client.cs"?

function M4A1Image::onNoAmmo(%this, %obj, %slot)
{
	GUICrossHair.Visible = "0";
	GUICrossHairVuoto.Visible = "1";
}

function M4A1Image::onReady(%this, %obj, %slot)
{
	if ($ZoomOn == false)
	{
		GUICrossHair.Visible = "1";
		GUICrossHairVuoto.Visible = "0";
	}
	else
	{
		GUICrossHair.Visible = "0";
		GUICrossHairVuoto.Visible = "0";
	}
}
#5
06/11/2006 (12:25 pm)
Never ... i don't have a succes...for mu test....The image change only on server....
Any person....Help ME? help thanks