Jump to content

Client Side Image script Issue... (onClientResourceStart)


Recommended Posts

I have a simple script with a Dumb issue.

it shows a Semi-transparent URL in the top corner of the Screen, and a Fancy radar mod in the bottom left (Just .png images)

But the script has an issue.

If ANY recource is loaded (This includes Map changes) the images Doubble up, making the Semi-transparent areas darker, and because the one around the radar has a slight tint to it, after about 6 map changes, the Radar turns completley black, because the .png is doubbled up so many times...

I have no idea whats wrong with it. other than its Putting the images up over and over each time ANY recource is loaded.

Where as it SHOULD only place them up when it is loaded first time.

function displayMainPlate() 
  guiCreateStaticImage(0.68, 0, 0.32, 0.08333, 'url.png', true, nil) 
  RadarCover = guiCreateStaticImage(0, 0.71917, 0.2875, 0.28083, 'radar.png', true, nil) 
  guiMoveToBack( RadarCover ) 
end 
  
addEventHandler ( "onClientResourceStart", getRootElement(getThisResource()), displayMainPlate ) 

Whats wrong?

Link to comment
  • 3 weeks later...

to get somthing to trigger on Server Recource load of itself... is all i have to change this:

addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),displayMainPlate) 

To this:

addEventHandler("onServerResourceStart",getResourceRootElement(getThisResource()),DisplayMapCreator) 

Or is there somthing more to it? like a section that shouldnt be there, or?

(its to go in a script that will output to everyones chat that the map that just loaded was made by me, so im putting it in with my map files.)

function DisplayMapCreator() 
  outputChatBox ( "#FFFFFFThis map was created By #FCE059[PS]#A85AFFDazzaJay#FFFFFF[AU]", player, 255, 255, 255, true )  
end  
) 
  
addEventHandler("onServerResourceStart",getResourceRootElement(getThisResource()),DisplayMapCreator) 

Link to comment

Well, its not working, and i have no idea why... (then again, my knowlage of scripting is enought to copy sections of code from other scripts and put them together with guesswork)

function DisplayMapCreator() 
  outputChatBox ( "#FFFFFFThis map was created By #FCE059[PS]#A85AFFDazzaJay#FFFFFF[AU]", getRootElement(), 255, 255, 255, true )  
end  
) 
  
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),DisplayMapCreator) 

and the error is: INFO: Loading Script Failed: ...ver 2 DM Race/mods.deathmatch/resourcecache/race-PHS 0000 Track/dazz.lua:4: unexpected symbol near ')'

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...