Jump to content

Gang zones


GRascm

Recommended Posts

Hi everyone, i need a little help with scripting.

I am writing an Roleplay server, and i want to add some DM elements such as gang wars for territory under control, gangs will get some % from business on their territory, but it is not main.

Main is: i have no idea how to do it, Can you help me? just a simple code, even not working code.

There are many little gang zones(more than one hundred) and 4 bands.

Link to comment

Please understand that you can't just ask for a script to be made for you, don't you think we have better things to do in our time? You'll have to do it yourself, we can help you with some parts of it, but we won't do it for you. Refer to the wiki for more information on scripts and scripting.

Link to comment
Please understand that you can't just ask for a script to be made for you, don't you think we have better things to do in our time? You'll have to do it yourself, we can help you with some parts of it, but we won't do it for you. Refer to the wiki for more information on scripts and scripting.

Maybe I'm wrong words, or not correctly translated, but I tried to ask only idea how to do it, I'm pretty good scripters to do everything myself, I just could not think of the principle of implementation.

Link to comment

Yes, I asked about the idea of scripting, even though I consider myself a good scripters, I sometimes need help, and there is nothing strange.

You get by a negative attitude to the newcomers, if I ask you help, it does not mean that I ask to do everything for me (although some people do so), I just asked the ideas ... no matter on what basis would the seizure occurred, the main idea, and then I figured out ...

Actually if anyone is interested I have done everything myself, without any help, realized it this way:

When onPlayerWasted event is triggered I check whether the gang member in his area and was, he killed a player opposing gangs located in that area, and if so then start the timer-

setTimer(checkCaptureTime, 1000, 1, 0, areaID, playerInfo[killer]["gang"], playerInfo[source]["gang"], currentArea)

Here is code of the function:

function checkCaptureTime(num, areaID, attackGang, defendGang, area)
stillCapturing = false
local allPlayers = getElementsByType("player")
for k, player in ipairs(allPlayers) do
	--here we check if player from attacking gang is on current zone, then attack still in progress and stillCapturing = true
end
 
if stillCapturing then
	if num < 300 then --if num < 300 then the battle lasted less than 5 minutes, continue with check timer
		setTimer(checkCaptureTime, 1000, 1, num+1, areaID, attackGang, defendGang, area)
	else -- This means that the gang had no time to beat off for 5 minutes, and the territory was conquered by an enemy gang
		outputChatBox("Gang ID "..defendGang.." loosed it's zone, now it zone of Gang ID "..attackGang )
		setRadarAreaColor(area, 0, 255, 0, 100)--actually we ned to redraw to the new band color here...
		setRadarAreaFlashing(area, false)
		zoneInfo[areaID]["gangID"] = attackGang
	end
else
	outputChatBox("Gang ID "..defendGang.." defended it's zone")--It mean that all enemies was killed, and zone was defended
end
end

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