Jump to content

[HELP] Creating Turf System


Recommended Posts

Hello,

Today I started making my own turf (colshape) system for gangs to capture.

But, I really confused in few things:

  • I want make turf system with requiredMembers to Capture, for example bigger turf more player it needs.
  • Also every player would have a timer, which it was in turf and if he dies or leaves the turf it decreases time from total capturing time, for example time is 4:31 and 1player leaves turf and it increases time to 5:01 and then he rushes back to turf and then it decreases time by 30seconds (time it was in turf)
  • No Military vehicles like Hydra, SS, Rhino or Hunter can shoot in capturing zone until it finishes.
  • It would notify enemy gang if it's turf is being capturing and would display timer on top,
  • Other gangs couldn't kill neither Attacker or Defender because it would be Teaming with another gang which is not fair.

Attack  Defend 

HPQAXCz.png

There would be 5types of Turfs

  1. Huge - it would require 5people to capture turf and hourly payment for every would be 100k to Gang Bank. ( 8 minutes)
  2. Big -  4 People and it would give 70k hourly ( 6:30 minutes)
  3. Normal - 3 People 40k (5 minutes)
  4. Little - 2 People and 25k (3 Minutes)
  5. Base - It would require 3players and it would be where gang could buy stuff from Gang Bank (6Minutes)

I had never made turf system, so I dont know what things to use, and need your help.

Link to comment
11 minutes ago, Dziugasc said:
  • Other gangs couldn't kill neither Attacker or Defender because it would be Teaming with another gang which is not fair.

To do this you can cancel onClientPlayerDamage. Make sure you run the cancelling logic on every client, this is important for sync.

13 minutes ago, Dziugasc said:
  •  It would notify enemy gang if it's turf is being capturing and would display timer on top,

You can implement the timer display using dxDrawText. Use getTickCount to record the start time instead of increasing a counter every second.

If gangs are implemented using MTA's team system, you can use getPlayersInTeam and trigger an event to those players.

 

15 minutes ago, Dziugasc said:
  • Also every player would have a timer, which it was in turf and if he dies or leaves the turf it decreases time from total capturing time, for example time is 4:31 and 1player leaves turf and it increases time to 5:01 and then he rushes back to turf and then it decreases time by 30seconds (time it was in turf)

You can modify the "start time" instead of every player having a timer. Assuming you want everyone to see the same timer. You'd modify the "start time" by subtracting 30s when they enter the turf (this means they have "spent more time capturing the turf"), or adding 30s when they leave the turf (meaning they have now "spent less time").

Note:

timeSpent = getTickCount() - startTime

 

17 minutes ago, Dziugasc said:

No Military vehicles like Hydra, SS, Rhino or Hunter can shoot in capturing zone until it finishes

You can use toggleControl with vehicle_fire / vehicle_secondary_fire. See "Control names". This will prevent those vehicles from firing whilst inside the turf. You may want to use a separate colshape to ensure that people outside the turf aren't shooting into the turf area, if that makes sense. You may also want to say "You are too close to a turf war to fire this vehicle!"

 

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...