Liberty Unleashed

Scripting => Script Help => Topic started by: Thomas1907 on May 21, 2011, 07:23:59 pm

Title: Image on connection to server
Post by: Thomas1907 on May 21, 2011, 07:23:59 pm
Hello i want a script so if player enter my server they see a image but i saw an other script but it doesnt work
the server wont load it!?
help plz
Title: Re: Image on connection to server
Post by: Windlord on May 22, 2011, 12:28:48 am
What you need is a client-side script which you add into Script.xml in the following manner:
Code: [Select]
<script file="ZoomInOnPlayer.nut" client="1"/>
The functions you need to use can be found below:
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Functions#Sprite_Functions

and examples for creating GUI elements are aplenty in Script Releases (http://forum.liberty-unleashed.co.uk/index.php?board=19.0).
Title: Re: Image on connection to server
Post by: Thomas1907 on May 22, 2011, 10:41:16 am
i have that but if i change the 1 to a 0 i see it in server.exe and i know if i change it back to 1 it ownt be displayed because it is a client script,, but it says on script load message to a player that it is loaded but i dont see it
Title: Re: Image on connection to server
Post by: Windlord on May 22, 2011, 11:02:38 am
Press ` ingame to open your console.
It echoes there.
Title: Re: Image on connection to server
Post by: Thomas1907 on May 22, 2011, 11:20:03 am
Yeah i see it there but the only thing i dont see is the picture i only changed gif to jpg and made the picture a jpg ??
both names in script and picture is a.jpg in script it is also a.jpg not a.JPG
Title: Re: Image on connection to server
Post by: Windlord on May 22, 2011, 12:48:44 pm
Did you add the image file to your Script.xml?
Title: Re: Image on connection to server
Post by: Thomas1907 on May 22, 2011, 01:23:43 pm
i did so ,, i think i uploaded the map here
http://www.2shared.com/file/VRmLNkMP/Script.html
it also says ingame with `button that its loaded so its the image it think i will try bmp once then img

Edit1:
hm thought i got it but not,, look at this: Look at reklama
Code: [Select]
g_pLocalPlayer <- FindLocalPlayer();

function onScriptLoad()
{
print( ">> image script by xXxMDjxXx loaded\n" );
g_Reklama <- GUISprite( "a.gif", VectorScreen( ScreenWidth - 150, ScreenHeight - 500 ) );
g_Reklama.Visible = false;    <----------------------------------------

AddGUILayer( g_Reklama );

return 1;

}

function onClientRequestClass( pClass )
{

g_reklama.Visible = true;

return 1;

}

function onClientSpawn( pClass )
{

g_reklama.Visible = false;    <-------------------------------

return 1;

}

Edit2:
One thing more i dont see a location?

EDIT YOUR POSTS AND DON'T TRIPLE POST
Title: Re: Image on connection to server
Post by: Windlord on May 22, 2011, 02:20:06 pm
Please use the post Modify feature.
The problem is obvious but I'll only help if you get rid of the triple post :/
Title: Re: Image on connection to server
Post by: Orpheus on May 22, 2011, 02:28:52 pm
I have to agree with Windlord on this one, I haven't seen triple posting in YEARS, please try to refrain from multi-posting, The modify button was created for a reason.

Regards Orpheus.

EDIT: See how it now says I modified this post. It's useful :)
Title: Re: Image on connection to server
Post by: Thomas1907 on May 22, 2011, 02:49:17 pm
ok srry but how can i solve the problem ??
i want the picture ingame but is it the script or the picture??
Title: Re: Image on connection to server
Post by: Windlord on May 22, 2011, 02:55:41 pm
Seems you don't get it so I edited your post for you.

With regards to your issue, remember that you only have a.jpg available, not a.gif.
Also, Squirrel is case-sensitive and therefore g_Reklama is not equivalent to g_reklama.
Title: Re: Image on connection to server
Post by: Thomas1907 on May 22, 2011, 03:32:51 pm
Thx for the help i got it working by adding a client.nut
If you want the package here it is: http://www.2shared.com/file/mPG4FdR3/ImageOnConnect.html

THY! ;D

But now i Searched on WIKI for a Position i added GUISprite.pos = 500, 500
but now i dont see the picture anymore!?
Title: Re: Image on connection to server
Post by: Windlord on May 22, 2011, 04:18:20 pm
Great!

It'll have to be
Code: [Select]
GUISprite.Pos = VectorScreen( 500, 500 );
Title: Re: Image on connection to server
Post by: Thomas1907 on May 22, 2011, 04:59:44 pm
Nothings changing is there a specific place to put it or not?

Never mind

Solved!