Ulysses
General => Developers Corner => Topic started by: FTWPanda on June 17, 2017, 04:47:42 AM
-
Hello People,
So ive set up a Prophunt server, which has come along well and i only need to fix a few more things.
My main concern is that i have yet to implement that taunting gives you points, but i have no idea how to do something like that.
Any answer is appreciated.
kind Regards,
FTWPanda
-
Use this hook with your function to give pointshop points:
http://wiki.garrysmod.com/page/GM/PlayerStartTaunt
-
Use this hook with your function to give pointshop points:
http://wiki.garrysmod.com/page/GM/PlayerStartTaunt
I already have the taunting implemented, i just dont know how to give points for it. Im not sure how that would help me with this.
But thank you anyway.
-
We don't understand your challenge.
You'd have to find the Pointshop function to give points. I presume there's a Wiki somewhere for pointshop.
Then, with the hook MrPresident gave you, you'd simply write a function to give points depending on whatever conditions you wanted, as I presume you wouldn't want to give points every single time someone taunted or no one would ever play the game, they'd be standing around taunting all the time.
Pseudo code (this won't work, I don't know Pointshop, and it's not 100 Gmod lua; it's just the logic idea.
function add_taunt_point( ply, t_id, len ) {
if blah then -- (some comparison here to prevent taunt flood, or even a taunt id to look for specific)
Pointshop.addpoint (ply, #) -- again, that's made up
end
}
hook.add ( "PlayerStartTaunt", "my_taunt_point_add", add_taunt_point )
-
We don't understand your challenge.
You'd have to find the Pointshop function to give points. I presume there's a Wiki somewhere for pointshop.
Then, with the hook MrPresident gave you, you'd simply write a function to give points depending on whatever conditions you wanted, as I presume you wouldn't want to give points every single time someone taunted or no one would ever play the game, they'd be standing around taunting all the time.
Pseudo code (this won't work, I don't know Pointshop, and it's not 100 Gmod lua; it's just the logic idea.
function add_taunt_point( ply, t_id, len ) {
if blah then -- (some comparison here to prevent taunt flood, or even a taunt id to look for specific)
Pointshop.addpoint (ply, #) -- again, that's made up
end
}
hook.add ( "PlayerStartTaunt", "my_taunt_point_add", add_taunt_point )
The command to add points would be: ply:PS_GivePoints(amount)
but i am not sure in what folder i would have to add it into and how to get the length of the taunts. I am using Prophunt : Enhanced by Wolvindra which includes a taunt option.
-
I gave you the way to detect a taunt and you already know the way to add points..
If you are still confused or need more specific ways for your gamemode, then maybe this is a question better suited for the developers of Pointshop or Prophunt.
-
Basically here at Ulysses, we encourage learning.
We will guide you on the right path and help you by giving you resources to learn how to do what you ask, but this is not the place to come and expect people to write things for you.
-
Oh i didnt realize that was to detect taunts, i will try to implement it^^
Thank you very much.
-
Okay, so ive tried implementing it like this:
if pl:Team() == TEAM_HUNTERS then
rand_taunt = table.Random(PHE.HUNTER_TAUNTS)
else
rand_taunt = table.Random(PHE.PROP_TAUNTS)
GM:PlayerStartTaunt(ply, length)
ply:PS_GivePoints(length)
ply:PS_Notify("You've been awarded " .. length .. " Points for taunting!")
end
but that made it so the taunt via f3 stopped working. What am i doing wrong here? do i need to define the length for every possibilty or did i miss something?
-
What I sent you was a hook. You need to set it up like a hook.
JamminR gave you an example.
-
Oh okay i will try that, thank you for helping