General > Developers Corner

Pointshop Points for taunting

(1/3) > >>

FTWPanda:
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

MrPresident:
Use this hook with your function to give pointshop points:

http://wiki.garrysmod.com/page/GM/PlayerStartTaunt

FTWPanda:

--- Quote from: MrPresident on June 17, 2017, 06:30:51 PM ---Use this hook with your function to give pointshop points:

http://wiki.garrysmod.com/page/GM/PlayerStartTaunt

--- End quote ---

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.

JamminR:
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.

--- Code: ---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 )
--- End code ---

FTWPanda:

--- Quote from: JamminR on June 18, 2017, 08:03:52 AM ---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.

--- Code: ---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 )
--- End code ---

--- End quote ---

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.

Navigation

[0] Message Index

[#] Next page

Go to full version