.:HyPeX:. Posted December 22, 2014 Posted December 22, 2014 Well.. its kinda funny: function CheckPossibleMap(res) local ResType = getResourceInfo(res, "type") outputChatBox(ResType) if ResType == "map" then local ResMode = getResourceInfo(res,"gamemode") outputChatBox(ResMode) if ResMode == "race" then local Name = getResourceInfo(res, "name") outputChatBox(Name) chatbox: Map '[DM] CooN Vol4 - Peaceful Finale' started. map Notice: Collisions are turned off for this map Not sure why the rest isnt being done... EDIT: Wrong forum, can someone please move this to scripting? Thanks! EDIT2: Thanks for moving!
.:HyPeX:. Posted December 22, 2014 Author Posted December 22, 2014 Simply its not working.. addEventHandler("onResourceStart", root, function(res) CheckPossibleMap(res) end) function CheckPossibleMap(res) local ResType = getResourceInfo(res, "type") outputChatBox(ResType) if ResType == "map" then local ResMode = getResourceInfo(res,"gamemode") outputChatBox(ResMode) if ResMode == "race" then local Name = getResourceInfo(res, "name") outputChatBox(Name) if Name then if not g_TopTimesDatabase[getResourceName(res)] then g_TopTimesDatabase[getResourceName(res)] = {} g_TopTimesDatabase[getResourceName(res)].name = Name g_TopTimesDatabase[getResourceName(res)].author = getResourceInfo(res,"author") g_TopTimesDatabase[getResourceName(res)].date = getRealTime().timestamp g_TopTimesDatabase[getResourceName(res)].playcount = 1 g_TopTimesDatabase[getResourceName(res)].huntercount = 0 g_TopTimesDatabase[getResourceName(res)].likes = 0 g_TopTimesDatabase[getResourceName(res)].toptimes = {} currentRes = res outputChatBox("Toptimes: Map".. Name.. " Loaded!", root, 255,255,255,true) else g_TopTimesDatabase[getResourceName(res)].playcount = g_TopTimesDatabase[getResourceName(res)].playcount + 1 currentRes = res outputChatBox("Toptimes: Map".. Name.. " Loaded!", root, 255,255,255,true) end end end end end
Feche1320 Posted December 23, 2014 Posted December 23, 2014 local ResMode = getResourceInfo(res,"gamemode") It's gamemodeS, not gamemode.. local ResMode = getResourceInfo(res,"gamemodes")
.:HyPeX:. Posted December 23, 2014 Author Posted December 23, 2014 Oh... thanks! Didnt saw that... <info gamemodes="race" type="map" name="[DM] CooN Vol4 - Peaceful Finale" author="A black person" version="1.0.0" description="This is my first handmade map and also my last solo map, enjoy! - A black person"></info> By the way, i'm doing something wrong? i never get the outputChatBox addEvent("onPlayerPickUpRacePickup", true) addEventHandler("onPlayerPickUpRacePickup",root,function(id, type, veh) if veh == 425 then local serial = getPlayerSerial(source) local name = getPlayerName(source) local time = exports.race:getTimePassed() local country = exports.admin:getPlayerCountry(source) addNewTime(currentRes,serial,time,name,country) outputChatBox("Player "..name.." got a toptime "..time.. " country "..country, root, 255,255,255,true) end end)
Feche1320 Posted December 23, 2014 Posted December 23, 2014 Where does currentRes come from? addNewTime(currentRes, serial, time, name, country)
.:HyPeX:. Posted December 23, 2014 Author Posted December 23, 2014 Where does currentRes come from? addNewTime(currentRes, serial, time, name, country) Global variable, defined in the previous function, on map start.
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