Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

3 years ago

Advertisement
May 27, 2020, 10:22:38 am

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - [GK7]Nakroma

Pages: [1]
1
Scripting support / What im doing wrong (Network:Send)
« on: December 26, 2013, 08:00:37 pm »
This is quite embarassing, but what the heck im doing wrong?
The error message is this:
"try to index local 'player' a nil value"
Here's how I call (clientside) the function:
Code: [Select]
Network:Send( "CtS_UpdateFaction" ) And this is my serverside code:
Code: [Select]
...
Network:Subscribe( "CtS_UpdateFaction", self, self.CtS_UpdateFaction )
...

function GK7Factions:CtS_UpdateFaction( player )
local qry = SQL:Query( "select * from gk7rp_factions where steamid = (?)" )
qry:Bind( 1, player:GetSteamId().id )
And at qry:Bind it displays the error. The strange thing is, I have kind of the same function twice and in the other one it works without a thing :/
Lg

2
GK7_Votekick

GK7_Votekick Download

Features
- Highly configurable
- Admin support

Usage
Votekick someone: /votekick <playername> [reason]
Adminmanagement: /votekickadmin <del/add> <playername> <password>
Abort votekick(admin only): /votekickabort
You can find and change the password in your config (see >Configuration for more information)

Setup
1. Choose a download link
2. Download the .zip from GitHub
3. Extract the .zip
4. Copy the 'gk7_votekick' folder into your /scripts/ folder

Configure it
Go into your /scripts/gk7_votekick/server/ and open gk7_votekick.lua with notepad.
On line 5 you will find the config, it's really self explanatory.
Make sure you change your admin password!
If you want to change the commands, go to 45 and change the "/command"'s to "/yourcommand".



Changelog
24.12.13 - V1.1.1
  • fixed a breaking bug

22.12.13 - V1.1
  • added adminmanagement
  • added abort command
  • added time display

21.12.13 - V1.0

3
Scripting support / Deleting something from a BaseWindow
« on: December 21, 2013, 05:57:34 pm »
Edit: Well I solved it, can't delete the thread tough.

Hey,
So here is in short form, my problem:
I have a vgui with a new tab for every skill my job has. The problem is, when I change class, the old tab from the other class is still there, and I don't know how to delete the old one.

This is my CreateCategory function, where the category gets created (Inventory is standard, but the skills need to get a new tab)
Code: [Select]
function GK7Inv:CreateCategory( category_name, description )
    local t = {}
    t.window = BaseWindow.Create( self.window )
    t.window:SetDock( GwenPosition.Fill )
    t.button = self.tab_control:AddPage( category_name, t.window )

    t.tab_control = TabControl.Create( t.window )
    t.tab_control:SetDock( GwenPosition.Fill )

if category_name == "Inventory" then
-- not important
else
t.contents = Label.Create( t.window )
t.contents:SetText( description )
t.contents:SetDock( GwenPosition.Center )
t.contents:SizeToContents()
end

    t.categories = {}

    self.categories[category_name] = t

    return t
end

Is there any way to delete all tabs at once? I already tried to delete everything from self.categories, doesn't quite work.

Lg

4
Releases / GK7_Motd - Display Motd/Rules on player join [V1.4]
« on: December 21, 2013, 01:31:02 pm »
GK7_Motd

GK7_Motd Download

Features
- Open MOTD on player join
- Open it again with a command or key
- Highly configurable

Setup
1. Choose a download link
2. Download the .zip from GitHub
3. Extract the .zip
4. Copy the 'gk7_motd' folder into your /scripts/ folder

Configure it
Go into your /scripts/gk7_motd/client/ and open gk7_motd.lua with notepad.
On line 5 you will find the config, it's really self explanatory.
If you want to change the /motd command, you can if you go into /scripts/gk7_motd/server/ and open gk7_motd.lua with notepad go to line 16 and change "/motd" to "/yourcommand".



Changelog
13.01.14 - V1.4:
  • - Added option don't spawn player until Motd is closed (thanks to @Jman100)

07.01.14 - V1.3:
  • - Added a configurable openkey
  • - Added color example

26.12.13 - V1.2.1:
  • - Added a serverside config

23.12.13 - V1.2:
  • - Added an option to let the player use controls while the MOTD is active

21.12.13 - V1.1:
  • - Couple of bugfixes
  • - Edited config section for more understandability

21.12.13 - V1.0

5
Scripting support / Get Local Player?
« on: December 20, 2013, 02:00:30 pm »
Hey,

Is there any way to retrieve the Player Object from the client? (LocalPlayer() didnt work)
It's because I need to send the Player Object with
Code: [Select]
Network:Send( "UpdateItems" ) to the server, but I don't know how to get the Player Object to my serverside function.

Mfg

6
Scripting support / How to retrieve the length of an array?
« on: December 18, 2013, 09:11:33 pm »
#t doesn't work.
Example:
Code: [Select]
for i=1, #aJobs doError:
Code: [Select]
Converting nullptr to instances
table.getn(t) doesn't work.
Example:
Code: [Select]
for i=1, table.getn(aJobs) doError:
Code: [Select]
attempt to call field 'getn' (a nil value)
aJobs:
Code: [Select]
aJobs = {}

aJobs[1] = {} -- Mafia
aJobs[1]["name"] = "Gangster" -- Display name
aJobs[1]["desc"] = -- Description
"Dies ist der Gangster.\n"..
"Hier kommt ein Icon rein.\n"..
"Blab er ist kriminell baum."
aJobs[1]["models"] = {} -- Models the job use
aJobs[1]["models"][1] = 39 -- Thug2
aJobs[1]["models"][2] = 78 -- Thug Boss
aJobs[1]["models"][3] = 69 -- Witness

aJobs[2] = {} -- Police
etc...

7
Scripting support / How to navigate with .lua to a directory above
« on: December 17, 2013, 08:48:44 pm »
I have something like this.
Code: [Select]
/config.lua
/client/init.lua

How can I include the config.lua with include() or dofile() from the init.lua?
Lg

Pages: [1]