Recent Posts

Pages: [1] 2 3 ... 10
1
General Chat & Help and Support / Re: Menu bug
« Last post by JamminR on Yesterday at 07:41:26 PM »
2
General Chat & Help and Support / Menu bug
« Last post by Zeo on Yesterday at 03:31:25 PM »
There is my bug : http://prntscr.com/kvzn8l i dont know how fix it please help me .
3
Developers Corner / Re: Custom Job Help
« Last post by Merlin on September 14, 2018, 04:35:31 PM »
Nope, that didn't resolve my issue.

And I just noticed another Custom Job doesn't have the PlayerLoadout function and the Ply:SetRunSpeed, Ply:SetWalkSpeed & Ply:SetJumpPower arguments don't work.

Is there a way to force a ULX command on a job when they spawn? If I can do that then I can force the ULX runspeed, walkspeed and jumppower commands on a job when they spawn.
4
Developers Corner / Re: Custom Job Help
« Last post by MrPresident on September 14, 2018, 03:04:51 PM »
Put this inside of playerspawn

hook.Call( "PlayerLoadout", GAMEMODE, ply )

that calls the gamemode's PlayerLoadout hook on the ply player object.
5
Developers Corner / Re: Custom Job Help
« Last post by Merlin on September 14, 2018, 02:39:42 PM »
Wait, can it be that PlayerLoadout is being called before PlayerSpawn and overriding the function?

Is there a way to add the PlayerLoadout function as an argument to the PlayerSpawn function?
6
Developers Corner / Re: Custom Job Help
« Last post by Merlin on September 12, 2018, 12:01:36 PM »
I would've most likely solved the problem if I were getting any lua errors but alas i'm not getting any ;-;
7
Developers Corner / Re: Custom Job Help
« Last post by iViscosity on September 12, 2018, 11:59:04 AM »
That's what I said... I'm not sure.

Maybe someone with more DarkRP knowledge could help you, because if I had to guess it's because of that. Do you know if you're getting any errors at all?
8
Developers Corner / Re: Custom Job Help
« Last post by Merlin on September 12, 2018, 11:53:46 AM »
Then why isn't the SetWalkSpeed, SetRunSpeed & SetJumpPower functions not working?
9
Developers Corner / Re: Custom Job Help
« Last post by iViscosity on September 12, 2018, 11:22:30 AM »
Now, I'd like to preface this with the fact that I don't know a ton about DarkRP. This is just information I found while looking up info.


I believe DarkRP's PlayerSpawn hook is overwriting this.

https://github.com/FPtje/DarkRP/blob/c25bc7f13d693f87353b78b18c986c2c3315b5f9/gamemode/modules/base/sv_gamemode_functions.lua#L743

That line calls this function: https://github.com/FPtje/DarkRP/blob/fd95cf68e6a01a1b0522c4a989d4512fc0fb202d/gamemode/modules/base/sv_util.lua#L157

Which overwrites walk speed, run speed, and jump power.

Looking at the lines:

Code: Lua
  1.     self:SetWalkSpeed(playerClass.WalkSpeed >= 0 and playerClass.WalkSpeed or GAMEMODE.Config.walkspeed)
  2.     self:SetRunSpeed(playerClass.RunSpeed >= 0 and playerClass.RunSpeed or (self:isCP() and GAMEMODE.Config.runspeedcp or GAMEMODE.Config.runspeed))
  3.     -- ...
  4.     -- Omitted for lack of relevance
  5.     -- ...
  6.     self:SetJumpPower(playerClass.JumpPower)
  7.  

(self referring to the player here), you should be able to include the "RunSpeed", "WalkSpeed", and "JumpSpeed" values into your actual team.


If that DOESN'T work, which -- after looking more into player_manager in the Sandbox gamemode -- might not, you could always try adding a timer to your PlayerSpawn to make sure those values are set after DarkRP sets them.


EDIT: Actually, my first solution there won't help. According to this line: https://github.com/FPtje/DarkRP/blob/c25bc7f13d693f87353b78b18c986c2c3315b5f9/gamemode/modules/base/sv_gamemode_functions.lua#L753, DarkRP already calls your custom PlayerSpawn hook if it exists... I'm not sure, in that case, since setting HP and armour work properly.
10
Developers Corner / Custom Job Help
« Last post by Merlin on September 12, 2018, 11:07:13 AM »
So the following arguments of the PlayerSpawn function (SetWalkSpeed, SetRunSpeed & SetJumpPower) are not working for any custom job after you spawn as the job, they just revert to default.

I have no custom spawn points system/script/addon.

Here's an example of a job with the PlayerSpawn function and arguments: (Due note that the HP & Armor arguments work as intended)

Code: [Select]
TEAM_CUSTOMK1 = DarkRP.createJob("Aimbotting Hacker", {
    color = Color(196, 7, 54, 255),
    model = {"models/player/baldi/baldi.mdl"},
    description = [[The Aimbotting Hacker, very quick and nimble, but more importantly than that, THE MOST BROKEN DARKRP JOB YOU'LL EVER SEE! Given 100 starting HP, no armor, super speed and super jump power and the most OP gun you'll see, the Aimbot Assault Rifle! Running from this monster will not help you, either attempt to kill him or take the bullet to the face! This job can start Mass Terrors just like the Taliban Terrorist but he's always KOS.

This is [Owner] Merlin's Custom Psycho Killer/Terrorist Job!

You can donate for a Custom Job yourself by typing !donate and going to the website given to you.]],
    weapons = {"weapon_aimbot_ar2", "pack_sswep_prize", "pack_sswep_puppet", "pack_sswep_baldi", "pack_sswep_baldi2", "pack_sswep_filename", "pack_sswep_sweep", "pack_sswep_bully", "pack_sswep_music", "pack_sswep_playtime", "pack_sswep_principal", "pack_sswep_principal2", "pack_sswep_ruler"},
    command = "aimbotter",
    max = 1,
    salary = 0,
    admin = 0,
    vote = false,
    hasLicense = true,
    candemote = false,
    category = "Custom Jobs",
PlayerLoadout = function(ply) return true end,
PlayerSpawn = function(ply)
        ply:SetMaxHealth(100)
        ply:SetHealth(100)
ply:SetArmor(0)
        ply:SetWalkSpeed(100)
        ply:SetRunSpeed(1750)
        ply:SetJumpPower(500)
    end,
    customCheck = function(ply) return CLIENT or
        table.HasValue({"STEAM_0:0:89866500"}, ply:SteamID())
    end,
    CustomCheckFailMsg = "Merlin's Custom Job, check !donate to get yours!",
})
Pages: [1] 2 3 ... 10