alwSmokE Posted October 4, 2009 Posted October 4, 2009 How do you get the map ratings to be displayed when the map starts? I want the chatbox to say something like: Blow the damn started rate 0/10 or something like that.
0 AcidbRain Posted October 6, 2009 Posted October 6, 2009 (edited) This should do the trick: Server local g_Root = getRootElement() -- defined in race_mapratings resource addEvent("onSendMapRating") addEventHandler("onSendMapRating", g_Root, function(mapRating) -- relay map rating to clients triggerClientEvent("onClientAcquireMapRating", g_Root, mapRating) end ) Client local g_Root = getRootElement() addEvent("onClientAcquireMapRating", true) addEventHandler("onClientAcquireMapRating", g_Root, function(mapRating) if mapRating then outputChatBox("This map is rated: "..tostring(mapRating.average).."/10") end end ) This is the simplest example; you can replace the outputChatBox with a more elaborate GUI output. Edit: mistake Edited October 7, 2009 by Guest
0 alwSmokE Posted October 6, 2009 Author Posted October 6, 2009 Hey thanks, but I have no idea what to do with that. I'm gonna try to figure it out, but I don't know that much about this stuff. My guess is sticking this somewhere in the mapratings_server.lua file? Or wait... is there a mapratings_client? hmmmm.... I might can figure this out... ***Edit*** I added those lines to the end of the mapratings_server.lua file. Then I added a file called mapratings_client.lua and put in the other lines. But it doesn't do anything.
0 alwSmokE Posted October 7, 2009 Author Posted October 7, 2009 Ok I edited the meta file (I think) to have a client thing as well. But this is what happens. I'm close... Any ideas? ***Edit*** Just messing with it, and and now it's starting to spam the chatbox: Rated 'Bball_Deftones' 6/10.-]alw[-SmokE[FG] rate 'Bball_Deftones' to 6/10 This map is rated: table: 14A488F0/10 This map is rated: table: 14A48EB8/10 This map is rated: table: 14A480D0/10 Map 'biggerbumpercars' started. This map is rated: table: 149DFEF8/10 This map is rated: table: 149E0D80/10 This map is rated: table: 149E22E8/10 This map is rated: table: 149E1A50/10 Rated 'biggerbumpercars' 7/10. -]alw[-SmokE[FG] rate 'biggerbumpercars' to 7/10 This map is rated: table: 14A8B3F8/10 This map is rated: table: 14A8B5D8/10 This map is rated: table: 14A8B8F8/10 This map is rated: table: 14A8BAB0/10 Changed rating from 7/10 to 6.5/10. -]alw[-SmokE[FG] rate 'biggerbumpercars' to 6.5/10 This map is rated: table: 14A66CE8/10 This map is rated: table: 14A67648/10 This map is rated: table: 14A66EF0/10 This map is rated: table: 14A63DB8/10 This map is rated: table: 14A5D878/10
0 AcidbRain Posted October 7, 2009 Posted October 7, 2009 Those two files weren't supposed to be added to the race_mapratings resource, but to be on a separate resource. The table output was due to a mistake, since the 'mapRating' variable actually has three fields: average, color, and count; what you want is the average. You should also check that it holds any value.
0 alwSmokE Posted October 7, 2009 Author Posted October 7, 2009 So...... ....how would you do that? ***EDIT*** I got it! Thanks for your help AcidbRain! https://community.multitheftauto.com/index.html?p ... ils&id=467 I hope you don't mind I released it to the general public as a resource... so now the great unwashed can enjoy it.
0 subenji99 Posted October 7, 2009 Posted October 7, 2009 I ended up coding one too, as our server would enjoy this feature. While this is bound to sound like blowing one's trumpet here, I extensively bugfixed my own, and got the output to match race_mapratings too. It's available: https://community.multitheftauto.com/index.html?p ... ils&id=468 should anyone want it, or just to compare differing methods of the same goal. Also of note: No need for a clientside file to handle the output when outputChatBox works serverside: it can even just output chat to just one player if necessary.
0 alwSmokE Posted October 8, 2009 Author Posted October 8, 2009 Benji, yours works better. If you can tell DazzaJay I'm banned from Pothole Studios forums again, that would be great. I think he's trying to keep someone else out, and I keep getting shafted. I don't want to be banzored.
0 DazzaJay Posted October 8, 2009 Posted October 8, 2009 yeah, your IP is the same as a dickhead spammer, cos your on the same ISP that useses dynamic ISP's. iil look into it. PM Me your current IP. :::EDIT::: Fixed.
Question
alwSmokE
How do you get the map ratings to be displayed when the map starts? I want the chatbox to say something like: Blow the damn started rate 0/10 or something like that.
8 answers to this question
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