• '<eof>' expected near end?
    9 replies, posted
I've never seen this error before and I have no idea what is going on. the server console tells me that it couldnt load the gamemode because: '<eof>' expected near end :line 45 Any help would be much appreciated. [lua]AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( 'shared.lua' ) local models = { "models/player/Group03/female_01.mdl", "models/player/Group03/female_02.mdl", "models/player/Group03/female_03.mdl", "models/player/Group03/female_04.mdl", "models/player/Group03/male_01.mdl", "models/player/Group03/male_02.mdl", "models/player/Group03/male_03.mdl", "models/player/Group03/male_04.mdl", "models/player/Group03/male_05.mdl", "models/player/Group03/male_06.mdl", "models/player/Group03/male_07.mdl", "models/player/Group03/male_08.mdl", "models/player/Group03/male_09.mdl", } // Serverside only stuff goes here /*--------------------------------------------------------- Name: gamemode:PlayerLoadout( ) Desc: Give the player the default spawning weapons/ammo ---------------------------------------------------------*/ function GM:PlayerLoadout( pl ) pl:GiveAmmo( 255, "Pistol", true ) pl:Give( "empty_weapon" ) end GM:PlayerInitialSpawn(pl) pl:SetPos(self:PlayerSelectSpawn(pl):GetPos()) //hook.Call("PlayerSetModel",GAMEMODE,pl) pl:SetModel(Model(models[math.random(#models)])) pl.HasChute = true DeployChute(pl) end function GM:PlayerSpawn(pl) pl:SetPos(self:PlayerSelectSpawn(pl):GetPos()) //hook.Call("PlayerSetModel",GAMEMODE,pl) pl:SetModel(Model(models[math.random(#models)])) if pl.HasChute DeployChute(pl) end end [/lua] [highlight](User was banned for this post ("Wrong forum" - Overv))[/highlight]
Line 36 is missing 'function'.
You have more ends than needed, probably at or near line 45 Edit: Couldn't see the code. Would people please use code tags :(
function GM:PlayerInitialSpawn(pl)
Ha. Yep the missing "function" was the problem. That wasn't a very well explained Error code. Thank Both of you by the way. I was testing when Bang Train posted :P
[PHP]local count = pokes[getCreatureName(item2.uid)].countlocal stnid = pokes[getCreatureName(item2.uid)].stoneid local stnid2 = pokes[getCreatureName(item2.uid)].stoneid2 local evo = pokes[getCreatureName(item2.uid)].evolution local levell = pokes[getCreatureName(item2.uid)].level if getPlayerLevel(cid) < pokes[getCreatureName(item2.uid)].level then return doPlayerSendCancel(cid, "Sorry, you don't have the required level to evolve this pokemon ("..levell..").") end local owner = getCreatureMaster(item2.uid) local pokeball = getPlayerSlotItem(cid, 8) local description = "Contains a "..evo.."." local nas = { ["%%pokename"] = pokes[getCreatureName(item2.uid)].evolution } for i,x in pairs(nas) do if description:find(i) then description = description:gsub(i, x) end local slo = pokes[getCreatureName(item2.uid)].maxh local sle = pokes[getCreatureName(item2.uid)].evolution doItemSetAttribute(pokeball.uid, "poke", "This is "..evo.."'s pokeball. HP = ["..pokes[getCreatureName(item2.uid)].maxh.."/"..pokes[getCreatureName(item2.uid)].maxh.."]") doItemSetAttribute(pokeball.uid, "description", description) doPlayerSendTextMessage(cid, 27, "Congratulations! Your "..getCreatureName(item2.uid).." evolved into a "..evo.."!") doSendMagicEffect(topos, 18) doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[sle].fotopoke) doSendMagicEffect(getThingPos(cid), 173) local oldpos = getThingPos(item2.uid) doRemoveCreature(item2.uid) doSummonMonster(cid, sle) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") doTeleportThing(pk, oldpos, false) doCreatureSetLookDir(pk, 2) setCreatureMaxHealth(pk, slo) doCreatureAddHealth(pk, slo) setCreatureMaxHealth(pk, getCreatureMaxHealth(pk) + (poken[getCreatureName(pk)].cons * getPlayerLevel(cid))) doCreatureAddHealth(pk, getCreatureMaxHealth(pk)) setPlayerStorageValue(cid, 2, 0) local i = getCreatureName(getCreatureSummons(cid)[1]) if not string.find(getPlayerStorageValue(cid, 54842), ""..i..",") then doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, getPlayerStorageValue(cid, 54842)..""..i..", ") return TRUE end end end end [/PHP]
[QUOTE=Qweeeery;31008746][PHP]local count = pokes[getCreatureName(item2.uid)].countlocal stnid = pokes[getCreatureName(item2.uid)].stoneid local stnid2 = pokes[getCreatureName(item2.uid)].stoneid2 local evo = pokes[getCreatureName(item2.uid)].evolution local levell = pokes[getCreatureName(item2.uid)].level if getPlayerLevel(cid) < pokes[getCreatureName(item2.uid)].level then return doPlayerSendCancel(cid, "Sorry, you don't have the required level to evolve this pokemon ("..levell..").") end local owner = getCreatureMaster(item2.uid) local pokeball = getPlayerSlotItem(cid, 8) local description = "Contains a "..evo.."." local nas = { ["%%pokename"] = pokes[getCreatureName(item2.uid)].evolution } for i,x in pairs(nas) do if description:find(i) then description = description:gsub(i, x) end local slo = pokes[getCreatureName(item2.uid)].maxh local sle = pokes[getCreatureName(item2.uid)].evolution doItemSetAttribute(pokeball.uid, "poke", "This is "..evo.."'s pokeball. HP = ["..pokes[getCreatureName(item2.uid)].maxh.."/"..pokes[getCreatureName(item2.uid)].maxh.."]") doItemSetAttribute(pokeball.uid, "description", description) doPlayerSendTextMessage(cid, 27, "Congratulations! Your "..getCreatureName(item2.uid).." evolved into a "..evo.."!") doSendMagicEffect(topos, 18) doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[sle].fotopoke) doSendMagicEffect(getThingPos(cid), 173) local oldpos = getThingPos(item2.uid) doRemoveCreature(item2.uid) doSummonMonster(cid, sle) local pk = getCreatureSummons(cid)[1] registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") doTeleportThing(pk, oldpos, false) doCreatureSetLookDir(pk, 2) setCreatureMaxHealth(pk, slo) doCreatureAddHealth(pk, slo) setCreatureMaxHealth(pk, getCreatureMaxHealth(pk) + (poken[getCreatureName(pk)].cons * getPlayerLevel(cid))) doCreatureAddHealth(pk, getCreatureMaxHealth(pk)) setPlayerStorageValue(cid, 2, 0) local i = getCreatureName(getCreatureSummons(cid)[1]) if not string.find(getPlayerStorageValue(cid, 54842), ""..i..",") then doPlayerAddSoul(cid, 1) setPlayerStorageValue(cid, 54842, getPlayerStorageValue(cid, 54842)..""..i..", ") return TRUE end end end end [/PHP][/QUOTE] Have you heard of pressing TAB once in your life? and you've obviously got too many ends at the end.
[QUOTE=Gfoose;31012598]Have you heard of pressing TAB once in your life? and you've obviously got too many ends at the end.[/QUOTE] He's doing it on purpose to infuriate us.
Uh, Overv, you do realize this thread is from 2 years ago right? :v: The Questions forum didn't exist when the OP made it.
[QUOTE=Lexic;31015680]Uh, Overv, you do realize this thread is from 2 years ago right? :v: The Questions forum didn't exist when the OP made it.[/QUOTE] OP's last visit was March, I don't think he'll mind
Sorry, you need to Log In to post a reply to this thread.