DazzaJay Posted May 29, 2008 Share Posted May 29, 2008 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
Remp Posted May 29, 2008 Share Posted May 29, 2008 addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),displayMainPlate) Link to comment
DazzaJay Posted May 29, 2008 Author Share Posted May 29, 2008 Thanks man, works perfectley. Link to comment
DazzaJay Posted June 17, 2008 Author Share Posted June 17, 2008 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
eAi Posted June 17, 2008 Share Posted June 17, 2008 I hate to be annoying, but both your questions could be answered by quickly reading the wiki... onServerResourceStart doesn't exit - onResourceStart does though. Link to comment
DazzaJay Posted June 17, 2008 Author Share Posted June 17, 2008 Well, that would be why the Wiki searches came back blank wouldnt it, i was searching for somthing that didnt exist. iil take another look at it, and report back if i got it working, or if it fails miserably. Link to comment
50p Posted June 18, 2008 Share Posted June 18, 2008 If you can't find an event or a function by using the search tool, try simply clicking the links on the left (navigation). Link to comment
DazzaJay Posted June 18, 2008 Author Share Posted June 18, 2008 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
50p Posted June 18, 2008 Share Posted June 18, 2008 Line 4: ')' is not needed. In Lua you close function by adding just "end" which you've done and that's fine. Just remove ) from line 4. Link to comment
DazzaJay Posted June 18, 2008 Author Share Posted June 18, 2008 Yeah, that got it. Thanks. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now