When i connect a server, my points count become 0, every time.
This happens when I insert bit of code to get points for killing like this
[URL="http://facepunch.com/showthread.php?t=1389120&p=44658203#post44658203"]Post[/URL]
[CODE]hook.Add("PlayerDeath", "", function( victim, inflictor, attacker )
if not IsValid(attacker) or not attacker:IsPlayer() then return end
if attacker == victim then return end
attacker:PS_GivePoints(5)
end)[/CODE]
Name your hook.
[QUOTE=code_gs;44665940]Name your hook.[/QUOTE]
What name i need? Just player or nickname?
[QUOTE=Dezigl;44666341]What name i need? Just player or nickname?[/QUOTE]
Name it anything.
[QUOTE=code_gs;44666358]Name it anything.[/QUOTE]
It can work?
Like that?
hook.Add("", "", function( victim, inflictor, attacker )
if not IsValid(attacker) or not attacker:IsPlayer() then return end
if attacker == victim then return end
attacker:PS_GivePoints(5)
end)
[LUA]
hook.Add("PlayerDeath", "ID_10_T", function( victim, inflictor, attacker )
if not IsValid(attacker) or not attacker:IsPlayer() then return end
if attacker == victim then return end
attacker:PS_GivePoints(5)
end)
[/LUA]
[QUOTE=Dezigl;44666473]It can work?
Like that?
hook.Add("", "", function( victim, inflictor, attacker )
if not IsValid(attacker) or not attacker:IsPlayer() then return end
if attacker == victim then return end
attacker:PS_GivePoints(5)
end)[/QUOTE]
No, don't delete the first string in parenthesis; just put a name in the second string.
You need the hook and name of the hook (which can be anything)
[CODE]hook.Add("PlayerDeath", "whatever", function( victim, inflictor, attacker )
--add rest of code
end)[/CODE]
yes guys, its work, thank you all.
Sorry, you need to Log In to post a reply to this thread.