Taalasmaa Posted May 14, 2010 Posted May 14, 2010 Hey, I'm making basic gamemode with votemaps and so on and I failed function tvhMap(startedMap) mapRoot = getResourceRootElement(startedMap) end addEventHandler("onGamemodeMapStart", getRootElement(), tvhMap) function humanityChosen() local spawn = getElementsByType("humanitySpawn", mapRoot) local x,y,z for key, value in pairs(spawn) do x = getElementData(value, "posX") y = getElementData(value, "posY") z = getElementData(value, "posZ") spawnPlayer(source,x,y,z) setCameraTarget(source,source) end end addEvent("humanity",true); addEventHandler("humanity",getRootElement(),humanityChosen) These are just parts of it, but it debugs an error about ERROR: Infite/Too long execution (mapmanager) ERROR: Aborting; infite running script What's wrong, it doesn't even start the map what i made. And trust me there's these humanityspawns on map file and the gamemodes for map file is set OK, like <meta> <info type="map" gamemodes="TestMode"/> <map src="junkyard.map"/> meta> and in my gamemode: <info author="Taalasmaa" type="gamemode" name="TestMode" version="0.0.1" /> Well, thanks. Best Regards Taalasmaa
dzek (varez) Posted May 14, 2010 Posted May 14, 2010 ERROR: Infite/Too long execution (mapmanager) you messed something with votes it think (as this is mapmanager infinite run, not your gamemode whatever its called) and.. local spawn = getElementsByType("humanitySpawn", mapRoot) local x,y,z for key, value in pairs(spawn) do x = getElementData(value, "posX") y = getElementData(value, "posY") z = getElementData(value, "posZ") spawnPlayer(source,x,y,z) setCameraTarget(source,source) end what you tried to do by that? it will spawn at last spawnpoint anyway ..
karlis Posted May 14, 2010 Posted May 14, 2010 local spawn = getElementsByType("humanitySpawn", mapRoot) local x,y,z for key, value in pairs(spawn) do x = getElementData(value, "posX") y = getElementData(value, "posY") z = getElementData(value, "posZ") spawnPlayer(source,x,y,z) setCameraTarget(source,source) end what you tried to do by that? it will spawn at last spawnpoint anyway .. no it wont, pairs() is outputing everything in random order
dzek (varez) Posted May 14, 2010 Posted May 14, 2010 pairs() is outputing everything in random order rly? that's weird.. anyway, looping through all spawnpoints, and spawning player at these place, and stop spawning after last random spawn -- not so good idea.. better is to choose one (random) and spawn.. and thats all
karlis Posted May 14, 2010 Posted May 14, 2010 i agree in tha point of view, but in wiki somewhere is script example exatcly like this
Taalasmaa Posted May 14, 2010 Author Posted May 14, 2010 So, any help? EDIT; It gives an error bad arguement #1 to 'pairs' So it seems that this gamemode doesn't detect any suitable maps, what's wrong? Help would be good
karlis Posted May 14, 2010 Posted May 14, 2010 try removing 2nd arg at getElementsByType, and check is the name right, then try again
Taalasmaa Posted May 14, 2010 Author Posted May 14, 2010 try removing 2nd arg at getElementsByType, and check is the name right, then try again Nvm, i fixed it, my server bugged Any gamemode didn't worked Now i'm angry because I spent many hours in trying to solve the problem and it was causing because of server...
Taalasmaa Posted May 15, 2010 Author Posted May 15, 2010 wth happend to the anticheat Nothing, i'm just making it way more better, because it got bugs
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