Author Topic: Image on connection to server  (Read 2741 times)

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Image on connection to server
« on: May 21, 2011, 08: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

Windlord

  • Guest
Re: Image on connection to server
« Reply #1 on: May 22, 2011, 01: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.

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Image on connection to server
« Reply #2 on: May 22, 2011, 11: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

Windlord

  • Guest
Re: Image on connection to server
« Reply #3 on: May 22, 2011, 12:02:38 pm »
Press ` ingame to open your console.
It echoes there.

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Image on connection to server
« Reply #4 on: May 22, 2011, 12:20:03 pm »
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

Windlord

  • Guest
Re: Image on connection to server
« Reply #5 on: May 22, 2011, 01:48:44 pm »
Did you add the image file to your Script.xml?

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Image on connection to server
« Reply #6 on: May 22, 2011, 02: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
« Last Edit: May 22, 2011, 03:54:19 pm by Windlord »

Windlord

  • Guest
Re: Image on connection to server
« Reply #7 on: May 22, 2011, 03: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 :/

Orpheus

  • Newbie
  • *
  • Posts: 49
  • Karma: +1/-0
  • Music is a way of life.
    • View Profile
    • Orphtown UK
Re: Image on connection to server
« Reply #8 on: May 22, 2011, 03: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 :)
« Last Edit: May 22, 2011, 03:32:18 pm by Orpheus »

Windows: A 64-bit/32-bit extension to a 16-bit GUI on an 8-bit OS written for a 4-bit architecture by a 2-bit company who can not stand 1-bit of competition.

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Image on connection to server
« Reply #9 on: May 22, 2011, 03: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??

Windlord

  • Guest
Re: Image on connection to server
« Reply #10 on: May 22, 2011, 03: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.

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Image on connection to server
« Reply #11 on: May 22, 2011, 04: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!?
« Last Edit: May 22, 2011, 05:09:12 pm by Thomas1907 »

Windlord

  • Guest
Re: Image on connection to server
« Reply #12 on: May 22, 2011, 05:18:20 pm »
Great!

It'll have to be
Code: [Select]
GUISprite.Pos = VectorScreen( 500, 500 );

Thomas1907

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Image on connection to server
« Reply #13 on: May 22, 2011, 05:59:44 pm »
Nothings changing is there a specific place to put it or not?

Never mind

Solved!
« Last Edit: May 22, 2011, 06:14:16 pm by Thomas1907 »

 

© Liberty Unleashed Team.