Jump to content

My first attempt to make MAP gamemode


Recommended Posts

Posted

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

http://www.sincitygaming.net - The next generation of gaming!

SinCity Gaming | UltiRace 24/7 - 188.165.199.162:22003

SinCity Gaming | Roleplay Gaming - Beta soon!

SinCity Gaming | Zombie Mode + - 188.165.199.162:22005

Instead of using ip: 188.165.199.162 you can use: sincitygaming.net

Posted

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 ..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
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

Posted
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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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

http://www.sincitygaming.net - The next generation of gaming!

SinCity Gaming | UltiRace 24/7 - 188.165.199.162:22003

SinCity Gaming | Roleplay Gaming - Beta soon!

SinCity Gaming | Zombie Mode + - 188.165.199.162:22005

Instead of using ip: 188.165.199.162 you can use: sincitygaming.net

Posted
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 :S Now i'm angry because I spent many hours in trying to solve the problem and it was causing because of server... :evil:

http://www.sincitygaming.net - The next generation of gaming!

SinCity Gaming | UltiRace 24/7 - 188.165.199.162:22003

SinCity Gaming | Roleplay Gaming - Beta soon!

SinCity Gaming | Zombie Mode + - 188.165.199.162:22005

Instead of using ip: 188.165.199.162 you can use: sincitygaming.net

Posted
wth happend to the anticheat xD

Nothing, i'm just making it way more better, because it got bugs :)

http://www.sincitygaming.net - The next generation of gaming!

SinCity Gaming | UltiRace 24/7 - 188.165.199.162:22003

SinCity Gaming | Roleplay Gaming - Beta soon!

SinCity Gaming | Zombie Mode + - 188.165.199.162:22005

Instead of using ip: 188.165.199.162 you can use: sincitygaming.net

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...