Hello,
First time i ask for help cause normally i just find it.
But this time i can't find help.
My jobs looks like this one :
[QUOTE]TEAM_scoutsnip = DarkRP.createJob("Scout spé Sniper", {
color = Color(96, 96, 96, 255),
model = {
"models/gonzo/imperialfistscout/imperialfistscout.mdl"
},
description = [[]],
weapons = {"wep_jack_job_drpradio","h3_sr_swep","tfa_nmrih_machete","weapon_blotpistol"},
command = "Scoutsnip",
max = 0,
salary = 50,
admin = 0,
vote = false,
candemote = false,
category = "Space Marines",
PlayerSpawn = function(ply) ply:SetRunSpeed(400) ply:SetWalkSpeed(150) ply:SetHealth(250) ply:SetMaxHealth(250)
end,
return ply:Team() == scoutsnip then ply:SetArmor(150))}
end[/QUOTE]
And it just don't work.
When i make it whit a simple setarmor like this :
[QUOTE]TEAM_sorcier = DarkRP.createJob("Sorcier", {
color = Color(96, 96, 96, 255),
model = {
"models/player/kogg/sorcerer_marine.mdl"
},
description = [[]],
weapons = {"weapon_chaosblotpistol","weapon_doom3_bfg","sfw_pulsar","sfw_aquamarine","sfw_thunderbolt","sfw_hornet"},
command = "sorcier",
max = 0,
salary = 50,
admin = 0,
vote = false,
candemote = false,
category = "Chaos",
PlayerSpawn = function(ply) ply:SetRunSpeed(200) ply:SetWalkSpeed(150) ply:SetCrouchedWalkSpeed( 1 ) ply:SetHealth(750) ply:SetMaxHealth(750) SetArmor(200)
end,
})
[/QUOTE]
Then it gives me this error :
[QUOTE]
[ERROR] A runtime error has occurred in "addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua" on line 71.
The best help I can give you is this:
'SetArmor' is being called like it is a function, but in reality does not exist (is nil).
Hints:
- You are doing something(<otherstuff>). The 'something' here does not exist.
The responsibility for the error above lies with (the authors of) one (or more) of these files:
1. addons/darkrpmodification-master/lua/darkrp_customthings/jobs.lua on line 71
2. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
3. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
4. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
5. gamemodes/darkrp/gamemode/libraries/fn.lua on line 84
6. gamemodes/darkrp/gamemode/modules/base/sv_gamemode_functions.lua on line 726
7. function 'Spawn'
8. gamemodes/base/gamemode/player.lua on line 115
------- End of Simplerr error -------
[/QUOTE]
Can u guys pls help me ?
You are doing SetArmor(200), not ply:SetArmor(200)
even when i do ply : setarmor () then it just don't work it still remain 100 base
The thing i said fixes your error, whatever happens after that, it's not related with the job
[CODE]
PlayerSpawn = function(ply) ply:SetRunSpeed(200) ply:SetWalkSpeed(150) ply:SetCrouchedWalkSpeed( 1 ) ply:SetHealth(750) ply:SetMaxHealth(750) SetArmor(200)
end,
[/CODE]
This should be like this if im not mistaken
[CODE]
PlayerSpawn = function(ply) ply:SetRunSpeed(200) ply:SetWalkSpeed(150) ply:SetCrouchedWalkSpeed( 1 ) ply:SetHealth(750) ply:SetMaxHealth(750) ply:SetArmor(200)
end,
[/CODE]
[QUOTE=EzGunzBlazzin;52220351][CODE]
PlayerSpawn = function(ply) ply:SetRunSpeed(200) ply:SetWalkSpeed(150) ply:SetCrouchedWalkSpeed( 1 ) ply:SetHealth(750) ply:SetMaxHealth(750) SetArmor(200)
end,
[/CODE]
This should be like this if im not mistaken
[CODE]
PlayerSpawn = function(ply) ply:SetRunSpeed(200) ply:SetWalkSpeed(150) ply:SetCrouchedWalkSpeed( 1 ) ply:SetHealth(750) ply:SetMaxHealth(750) ply:SetArmor(200)
end,
[/CODE][/QUOTE]
Yes but when i do it whit ply:SetArmor it does nothing :'( my armor stay at 100 as base (all jobs have 100 armor)
[code]return ply:Team() == scoutsnip then ply:SetArmor(150))}
end[/code]
What is this bit at the bottom? Why are you returning here and why is there no if? And why are you closing the parenthesis and the bracket? And then have a random end at the end? This is probably your issue aswell.
[QUOTE=dosam01;52222906]Yes but when i do it whit ply:SetArmor it does nothing :'( my armor stay at 100 as base (all jobs have 100 armor)[/QUOTE]
You sure it's not your hud?
[QUOTE=dosam01;52222906]Yes but when i do it whit ply:SetArmor it does nothing :'( my armor stay at 100 as base (all jobs have 100 armor)[/QUOTE]
Do you respawn after you change job?
Try using PlayerLoadout = function(ply) end instead of PlayerSpawn = function(ply) end
can it be the HUD ?
No it isn't, PlayerSpawn seems to be called just before the inital health and armor is set, so you have to set the armor in PlayerLoadout, which seems like it is called after the player fully spawned.
[QUOTE=RaKo;52258329]No it isn't, PlayerSpawn seems to be called just before the inital health and armor is set, so you have to set the armor in PlayerLoadout, which seems like it is called after the player fully spawned.[/QUOTE]
How do i do that ???
[QUOTE=dosam01;52258434]How do i do that ???[/QUOTE]
Change 'PlayerSpawn' to 'PlayerLoadout' ?
Sorry, you need to Log In to post a reply to this thread.