• Gamemode not loading
    16 replies, posted
I've created a gamemode, all functions in there to actually work, but when i select it from the drop down menu of the Create Multiplayer tab, and click create, i join, but it creates a sandbox server instead, WTH?
You need an info.txt for your gamemode, goes inside the (gamemode name) folder in gmod/gamemodes.
I have got that. [editline]09:10PM[/editline] Anyone?
Bump
Theres probbably an error... or something, check console and test gamemode_reload
Here is the error [code] Couldn't include file 'Garry Company/gamemode/init.lua' (File not found) ********************************************** ********************************************** ********** COULDN'T LOAD GAMEMODE!! ********** ********************************************** ********************************************** There was a problem opening the gamemode file 'Garry Company/gamemode/init.lua'[/code]
Take the space out of the folder name
You can't put spaces in the gamemode folder.
Thats what I just said....
Thank you King Flawless it worked. But now i'm getting this: [code] ERROR: GAMEMODE:'PlayerInitialSpawn' Failed: GarryCompany/gamemode/init.lua:23: attempt to call a string value[/code] If you need the line of code for that, please ask :3
paste code
I'll give you the whole function. [lua]function GM:PlayerInitialSpawn( ply ) self.BaseClass:PlayerInitialSpawn ( ply ) file.Write( "Garry Company/ServerPlayers.txt", "/nPlayerName: " ..ply:Nick() "/nPlayer SteamID: " ..ply:SteamID() "/nPlayer Kills: " ..ply:Frags() "/nPlayer Deaths: " ..ply:Deaths() ) if ply:IsSuperAdmin() then ply:SetModel( "models/player/fallout_3/tesla_power_armor.mdl" ) ply:PrintMessage( HUD_PRINTTALK, "GCompany: Welcome to the server I recognise you as a Super Admin /nName:" ..ply:Nick() "/nRank: Super Admin /nSteamID:" ..ply:UniqueID() ) ply:SetName( "(Super)" ..ply:Nick() ) elseif ply:IsAdmin() then ply:SetModel( "models/player/fallout_3/t51b.mdl" ) ply:PrintMessage( HUD_PRINTTALK, "GCompany: Welcome to the server I recognise you as an Admin /nName:" ..ply:Nick() "/nRank: Admin /nSteamID:" ..ply:UniqueID() ) ply:SetName( "(Admin)" ..ply:Nick() ) else ply:SetModel( "models/player/charple01.mdl" ) ply:PrintMessage( HUD_PRINTTALK, "GCompany: Welcome," ..ply:Nick() " to the GCompany Server, have fun, and obey the rules" ) ply:SetName( "(Guest)" ..ply:Nick() ) end[/lua]
line 23 would be?
[QUOTE=thejjokerr;21759180]file.Write( "Garry Company/ServerPlayers.txt", "/nPlayerName: " ..ply:Nick() "/nPlayer SteamID: " ..ply:SteamID() "/nPlayer Kills: " ..ply:Frags() "/nPlayer Deaths: " ..ply:Deaths() ) You are forgetting ..'s all over your code, make sure you put it like this local examplestring = "string" .. ply:SteamID() .. " more string" .. ply:Name() .. " The end." EDIT: Except if you do it at the end ofcourse: local lastexample = "My SteamID: " .. ply:SteamID()[/QUOTE] Thankyou, i thought you just put the ".." before the ply:blahblahblah stuff. Thanks for telling me
You place it between everything you want to contatenate into a single string.
[QUOTE=Crazy Quebec;21759660]You place it between everything you want to contatenate into a single string.[/QUOTE] Yeah well I didn't know, but thanks for telling me :D It's working now.
Sorry, you need to Log In to post a reply to this thread.