Author Topic: Pointshop Points for taunting  (Read 454 times)

0 Members and 1 Guest are viewing this topic.

Offline FTWPanda

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Pointshop Points for taunting
« 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

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2555
  • Karma: 391
    • View Profile
    • |G4P| Gman4President
Re: Pointshop Points for taunting
« Reply #1 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

Offline FTWPanda

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Pointshop Points for taunting
« Reply #2 on: June 18, 2017, 04:54:15 AM »
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.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7717
  • Karma: 350
  • Sertafide Ulysses Jenius
    • View Profile
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Pointshop Points for taunting
« Reply #3 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: [Select]
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 price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin

Offline FTWPanda

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Pointshop Points for taunting
« Reply #4 on: June 18, 2017, 09:26:02 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: [Select]
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.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2555
  • Karma: 391
    • View Profile
    • |G4P| Gman4President
Re: Pointshop Points for taunting
« Reply #5 on: June 18, 2017, 11:24:20 AM »
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.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2555
  • Karma: 391
    • View Profile
    • |G4P| Gman4President
Re: Pointshop Points for taunting
« Reply #6 on: June 18, 2017, 11:26:02 AM »
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.

Offline FTWPanda

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Pointshop Points for taunting
« Reply #7 on: June 20, 2017, 01:19:16 PM »
Oh i didnt realize that was to detect taunts, i will try to implement it^^

Thank you very much.

Offline FTWPanda

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Pointshop Points for taunting
« Reply #8 on: June 20, 2017, 01:29:45 PM »
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?

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2555
  • Karma: 391
    • View Profile
    • |G4P| Gman4President
Re: Pointshop Points for taunting
« Reply #9 on: June 20, 2017, 05:23:26 PM »
What I sent you was a hook. You need to set it up like a hook.

JamminR gave you an example.

Offline FTWPanda

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Pointshop Points for taunting
« Reply #10 on: June 21, 2017, 04:50:12 AM »
Oh okay i will try that, thank you for helping