the actual lua scripts are documented, the wiki isn't
If I can make a suggestion, can you add a way for us to easily add a data field to specific characters or every character on the server to save?(if there is already then I apologize the script is pretty large)
[QUOTE=Chessnut;42412518]client.character:SetData("foo", "bar")
client.character:GetData("foo")[/QUOTE]
Thank you
:eng101: + :smile: = :dance:
More updates!
[url]https://github.com/Chessnut/NutScript/commits/master[/url]
Now, I managed to fail to setup the gamemode on my server, I've putted into the autoexec.cfg:
[CODE]gamemode "Sample"[/CODE]
But it starts as Sandbox for some reason... The code of the Schema is here:
"sample"
[CODE]{
"base" "nutscript"
"title" "Sample"
"author" "Chessnut"
"menusystem" "1"
}[/CODE]
And so, on the console of the server, it shows this:
[CODE]Couldn't change active gamemode - 'Sample' not found[/CODE]
Before I fixed one faction I've made, the gamemode was starting up fine and all... Any ideas?
is the folder called 'Sample'?
[QUOTE=NightmareX91;42418227]is the folder called 'Sample'?[/QUOTE]
The folder is called 'sample' ... But I fixed it to 'Sample' and it continues to start as sandbox..
It has to be lower case I think
Yep, In fact you should lowercase everything..
Not only gamemode-folders, also addon-folders. Also never add spaces.
Pushed an important update that fixes characters not sending properly.
[QUOTE=Chessnut;42425158]Pushed an important update that fixes characters not sending properly.[/QUOTE]
Fuck yes.
Now that the gamemode was started, the models continue as errors, like, the models from a new faction I've made, they are all giant red errors.
I've putted the addon thing from where they came and putted it onto the /addons folder, extracted them with a .gma extractor and putted them into /garrysmod/models
The code for the models are here:
[CODE]FACTION_MARINE = 3
local FACTION = {}
FACTION.name = "Marine"
FACTION.uniqueID = "marine"
FACTION.desc = "Teste."
FACTION.color = Color(20, 150, 15)
FACTION.maleModels = {
"models/unsc_m01.mdl",
"models/unsc_m02.mdl",
"models/unsc_m03.mdl",
"models/unsc_m04.mdl",
"models/unsc_m05.mdl",
"models/unsc_m06.mdl",
"models/unsc_m07.mdl",
"models/unsc_m08.mdl",
"models/unsc_m09.mdl",
"models/unsc_m11.mdl"
}
FACTION.femaleModels = FACTION.maleModels
FACTION.isDefault = true
nut.faction.Register(FACTION_MARINE, FACTION)[/CODE]
[lua]
function PLUGIN:PlayerEnterArea(client, area)
local text = area.name
if (area.showTime) then
text = text..", "..os.date("!%X", nut.util.GetTime()).."."
end
nut.scroll.Send(text, client)
hook.Run("nut.PlayerEnterArea") --<this
end
[/lua]
Can you commit an edition with a hook like this so I can use from a schema plugin I am using. I'm requesting it because I'm trying to touch the Derived script as little as possible and I hope it wouldn't be to much of a bother to ask.
Uh, just add SCHEMA5:PlayerEnterArea(client, area) to your schema.
[QUOTE=freakyy;42422507]Yep, In fact you should lowercase everything..
Not only gamemode-folders, also addon-folders. Also never add spaces.[/QUOTE]
this isn't entirely accurate
I think Linux has issues with case sensitivity so it would be best to have lowercase stuff anyways.
[QUOTE=Chessnut;42432427]I think Linux has issues with case sensitivity so it would be best to have lowercase stuff anyways.[/QUOTE]
Linux' file system treats cases differently.
Example:
'Hi.txt' is a different file to 'hi.txt'
I have data I need to make sure is set after the character is created initially, what function should I use for this?
I added a PlayerCreatedCharacter hook.
I also have pushed an update to fix character networking (again for the hundredth time)
[code][ERROR] gamemodes/dissolution/plugins/pda/sh_plugin.lua:112: attempt to index field 'character' (a nil value)
[/code]
Hey Chessnut, the hook(PlayerCreatedCharacter) isn't called late enough. I'm getting the above error.
It is called when a character is created.
Anyone know the code for a command to give people money? - Not the type that's like /me gives him/her money. One that admins can use. Let's use an example. Player: [OOC]: Admin. I lost 5K can I be refunded?
Admin: [OOC]: Oh yes you can let me type the command n.
*Does the command to give them the money that he doesn't have in his inventory, like ass pulling and sets it to the players name*
*Admin has given Player 5000 moneys*
If you know what I'm on about. If you can help, thanks.
[QUOTE=soap755;42468684]Anyone know the code for a command to give people money? - Not the type that's like /me gives him/her money. One that admins can use. Let's use an example. Player: [OOC]: Admin. I lost 5K can I be refunded?
Admin: [OOC]: Oh yes you can let me type the command n.
*Does the command to give them the money that he doesn't have in his inventory, like ass pulling and sets it to the players name*
*Admin has given Player 5000 moneys*
If you know what I'm on about. If you can help, thanks.[/QUOTE]
Zipped through the code. Use SetMoney or GiveMoney.
For example, Player(3):SetMoney(30519503).
Changed it so 3dtext can use NutScript's version of the markup lib.
[img]http://i.imgur.com/NDnEhsE.png[/img]
[QUOTE=Chessnut;42502612]Changed it so 3dtext can use NutScript's version of the markup lib.
[img]http://i.imgur.com/NDnEhsE.png[/img][/QUOTE]
watch kuro copy this because he ran out of originality 5 years ago
What is different in nuts markup vs the default? You can pass material/textures now?
How do you go about adding materials now?
You can use materials basically and it has the ability to overwrite the way text is drawn using markup:DrawText(text, font, x, y, color, hAlign, vAlign, alpha).
For the images, use <img=path/to/image,AxB>. A and B are the width and height, and default to 16x16 for icons. So if you wanted to have the star like shown, use <img=icon16/star.png>Hello World
is W and H not good enough for width height? gotta be a hipster and use A and B eh?
A and B is the new X and Y, old man.
Sorry, you need to Log In to post a reply to this thread.