• Gmod 9 functions port
    9 replies, posted
Recently, I've been looking through gmod 9 and found some niche looking gamemodes. Of course, these use different functions to regular gmod, although the syntax in many is very similar. While I cannot offer anything, here is what I would like to ask: write a functions library to wrap around the gmod 9 functions, so all we'd need to do to port a gmod 9 gamemode is to use an include. It shouldn't be too hard from what I see (I've ported a few functions already for convenience) for someone experienced with gmod 9 lua to pull off. However, if anyone could find a garrysmod 9 wiki with the functions and stuff, it'd be really appreciated if you post it here. I guess the reward for this is seeing a revival of those old classics, and a brief reprise from the RP infestation we're undergoing :) Here's how far I've gotten -admittedly not far at all- I don't know enough gmod 9 lua to port many of the functions (or whether I've gotten the ones I have ported right) [lua] function pid(id) //Get the player from their entity index, gmod9 style return player.GetByID(id) end _OpenScript=include _CurTime=CurTime _PlayerGiveItem=function (plrid,weapon) local plr=pid(plrid) plr:Give(weapon) end _PlayerGiveAmmo=function (plrid,amount,ammotype,showpopup) local plr=pid(plrid) plr:GiveAmmo(amount,ammotype,showpopup) end _PlayerChangeTeam=function (plrid,newteam) local plr=pid(plrid) plr:SetTeam(newteam) end _EntFire=function(ent,comm,num1,num2) num1=num1 or 0 num2=num2 or 0 ent:Fire(comm, num1,num2) end _EntGetByName=function(entname) return ents.FindByName(entname)[1] end ToMinutesSeconds=function(time) return time*60 end _ServerCommand=function(command) game.ConsoleCommand(command) end _MaxPlayers=function() return MaxPlayers() end _PlayerSilentKill=function(plrid) local plr=pid(plrid) plr:KillSilent() end [/lua] I <3 whoever does this and releases it to the gmod general public
Surely it would be easier, quicker and just dam right better to recreate the gamemodes in gmod10 and not sit in the past.
[QUOTE=Science;32064437]Surely it would be easier, quicker and just dam right better to recreate the gamemodes in gmod10 and not sit in the past.[/QUOTE] If its gmod 9 they probably have. Unless it was crap.
[QUOTE=Science;32064437]Surely it would be easier, quicker and just dam right better to recreate the gamemodes in gmod10 and not sit in the past.[/QUOTE] Sure, but I'm sure just one simple port code would be nice to have if say, you wanted to run a retro gamemode server.
Not worth the hassel to be honest. But what ever floats your boat.
You should really look into tabbing.
[QUOTE=zzaacckk;32070116]You should really look into tabbing.[/QUOTE] Lol, I tried it and just can't get into it, it's more of an inconvenience than anything to me.
[QUOTE=Ylsid;32076135]Lol, I tried it and just can't get into it, it's more of an inconvenience than anything to me.[/QUOTE] After you start something you make a extra tab until you end it. [lua] function test() // Here I have a tab as I started something. if(true)then // And another tab as I started something else end // I just degraded a tab as I ended the last thing // All you are doing to tabbing everything thats effected by something specific // Such as a function, if statement, while loop, for loop, etc end [/lua] It really helps others trying to read your code.
Well to me it seems that gm9 lua port would be nice. Some people are still coding in gm9 lua. I saw gm9 hoverballs on garrysmod.org .
your code is really hard to read
Sorry, you need to Log In to post a reply to this thread.