Posted: 06-01-2016, 06:33 PM
(This post was last modified: 06-01-2016, 09:11 PM by Twitchyb1t.)
DarkRP levels system Rprint XP system
Here I will not just provide the addon Rprint (darkRP levels is free on the workshop link below) The code is already in my version of Rprint and if you do not have darkrp levels you dont have to delete any code.
I have put these images here to show you guys how the printers give xp
Path: rprint/lua/entities/rprint_base/init.lua Line 179
Path: rprint/lua/rprint/sh_config.lua Line 10
Now where we add our own printers we can use the Levelsystem parameter (will be used so you have to be a certain level to buy)
Path: rprint/lua/rprint/sh_rprint.lua Line 60
This is the most confusing part of the code I implemented.
It's job is to give an error if you have not given it a prefix
Path: rprint/lua/rprint/sh_rprint.lua Line 119
Here we are localizing the entity parameter we know as Levelsystem to the shared file.
This allows us to use the darkrp functions such as darkrp spawning through f4 / cmd and in our case the darkrp levels system.
we can then add the level sysstem parameter as a variable in AddEntity so that all our rprint printers have a default level requirement of 1 or a specified level in the printer config file.