Jump to content

IT07

Recommended Posts

And what is this supposed to mean? Are you hijacking my post or something? I think you don't realize what you just did: you interrupted the development of this script by posting that code. Do you want to show off or something? Seriously what is your problem.

 

Woah woah woah. Dude tries to help out by pointing out a potentially more optimized way of doing something and that's your response? What's the point in posting on community forums if you're going to respond like that to a reasonable post.

 

I think Grim was pointing out that it really isn't the best idea to add hundreds or potentially thousands of event handlers on someone which will error out as multiple things are trying to delete the same object, addEventHandler will just stack the EHs on top of each other I'm pretty sure so eventually, unless they are removed again, they will continue to be added. All Grim is saying, is that maybe consider using his system which removes the EH after and ensures multiple EHs are not added as they are not needed.

 

BenR

Link to comment
Share on other sites

Well if you want it for players only...

 

player addEventHandler ["Fired", 
{
	if(isPlayer cursorTarget)then
	{
		deleteVehicle (_this select 6);
	};
}];

if you want it for vehicles as well spawn 

this on a client 

 

while {true} do {
	waitUntil {uiSleep 0.5; player != vehicle player};
	private ["_veh","_eh"];
	_veh = vehicle player;
	_eh = _veh addEventHandler ["Fired", 
	{
		if(isPlayer cursorTarget)then
		{
			deleteVehicle (_this select 6);
		};
	}];
	waitUntil {uiSleep 0.5; _veh != player};
	_veh removeEventHandler ["Fired",_eh];
};

Untested, written in 2 minutes.

 

Bundled version : 

http://puu.sh/hXDVa/683f3df295.txt

 

have fun

 

it wont work with antihacks, since all eventhandlers like this is removed and banned for by default ...

 

@all

 

if you want this with default antihack you will need to add the eventhandler in your security_checks.h

 

if you want this with infistar you will need to add your code in the relevant event handler part of your run.sqf

 

if you want this without antihacks, you can use these scripts ... else it will not work!

Link to comment
Share on other sites

it wont work with antihacks, since all eventhandlers like this is removed and banned for by default ...

 

@all

 

if you want this with default antihack you will need to add the eventhandler in your security_checks.h

 

if you want this with infistar you will need to add your code in the relevant event handler part of your run.sqf

 

if you want this without antihacks, you can use these scripts ... else it will not work!

 

Well, some antihacks yes, however others (ie infiSTAR) have the functionality to allow custom event handlers...

Link to comment
Share on other sites

it wont work with antihacks, since all eventhandlers like this is removed and banned for by default ...

 

@all

 

if you want this with default antihack you will need to add the eventhandler in your security_checks.h

 

if you want this with infistar you will need to add your code in the relevant event handler part of your run.sqf

 

if you want this without antihacks, you can use these scripts ... else it will not work!

well OP's one does the same thing execpt it adds (# of EHs * time you enter a vehicle) and OP uses an switch for true false case

Link to comment
Share on other sites

Can you show me the line you used in your init.sqf?

if (!isDedicated and hasInterface) then
{
[] execVM "addons\Status_Bar\init_statusBar.sqf";
[] ExecVM "ScarCode\SC_PVE.sqf"; 
[] ExecVM "ScarCode\sRestartWarnings.sqf";
};
 
 
Now found...
But only work for me... (i am the admin) if i shot to any player i cant dead to other player.
But if other player shot to other player if can dead to other player.
 
i comment i use Infistar.
Link to comment
Share on other sites

well OP's one does the same thing execpt it adds (# of EHs * time you enter a vehicle) and OP uses an switch for true false case

 

Obviously you do not understand that this is a post that shows a script. Instead of posting "better code", you could've just PM'd me with the code you posted to prevent confusion for future visitors.

What if I at a later stadium update which DOES work or is better than the code you posted? Then your post will only be a confusion to visitors.

 

To make it even worse, your explenation of how my script works is completely wrong. Read it again.

But yes, I have to admit that the script is not optimal and perfect. But that is where learning and development comes in. Soon there will be a much much better version with new features and fixed issues.

Link to comment
Share on other sites

Obviously you do not understand that this is a post that shows a script. Instead of posting "better code", you could've just PM'd me with the code you posted to prevent confusion for future visitors.

What if I at a later stadium update which DOES work or is better than the code you posted? Then your post will only be a confusion to visitors.

 

To make it even worse, your explenation of how my script works is completely wrong. Read it again.

But yes, I have to admit that the script is not optimal and perfect. But that is where learning and development comes in. Soon there will be a much much better version with new features and fixed issues.

You're a wizard, teach me

Link to comment
Share on other sites

Hey, great script. Unfortunately I can't test to see if it actually prevents damage to other real players yet, because I'm still in the process of setting up my server with additional scripts. and except for the incorrect installation instructions ([] ExecVM"\ScarCode\SC_PVE.sqf"; should have been [] ExecVM"ScarCode\SC_PVE.sqf"; ) installation was easy. Thanks and keep up the good work.

Link to comment
Share on other sites

You're a wizard, teach me

 

You're not ready Harry.

 

 

Hey, great script. Unfortunately I can't test to see if it actually prevents damage to other real players yet, because I'm still in the process of setting up my server with additional scripts. and except for the incorrect installation instructions ([] ExecVM"\ScarCode\SC_PVE.sqf"; should have been [] ExecVM"ScarCode\SC_PVE.sqf"; ) installation was easy. Thanks and keep up the good work.

 

Thanks for mentioning the mistake I have corrected it :)

Link to comment
Share on other sites

Hi, good job on this update

 

u need to change PvE.sqf to SC_PvE.sqf in ur folder on github

 

& its work with regular players without pb & with infistar

 

but the problem its when infistar admin shoot  normal player he killed & kicked publicvariable restrection

playername (ip) GUID - #0 "SC_PvEkilled" = [b Alpha 1-2:1 (playername) REMOTE,B Alpha 1-1:1 (adminname) REMOTE]

 

i add !="SC_PvEkilled" to public variable but nothing change

i delete the line add on infistar & nothing change too

Link to comment
Share on other sites

Hi, will i need infistar for this to work or can I use it with the stock Epoch AH?

 

thanks

simon

 

I do not support the stock Epoch AH anymore. So I do not know to be honest if it works with it. It is worth a try though.

Link to comment
Share on other sites

Hi, good job on this update

 

u need to change PvE.sqf to SC_PvE.sqf in ur folder on github

 

& its work with regular players without pb & with infistar

 

but the problem its when infistar admin shoot  normal player he killed & kicked publicvariable restrection

playername (ip) GUID - #0 "SC_PvEkilled" = [b Alpha 1-2:1 (playername) REMOTE,B Alpha 1-1:1 (adminname) REMOTE]

 

i add !="SC_PvEkilled" to public variable but nothing change

i delete the line add on infistar & nothing change too

 

Thanks for notifying me about that mixup with SC_PvE.sqf :) I have corrected it in the README.md.

Also I totally forgot to include the BE filter exceptions. I have now put a txt file in the root of the gitHub page that shows you what to add to given files.

Let me know if that fixed your issue. Good luck!

Link to comment
Share on other sites

  • 4 weeks later...

Thx for This Huge Update NICE WORK :D

 

u need to add this to  infiSTARsettings.txt for ur epoch anti-pvp script

 

/*  custom _EHF Function */ _customFiredEventhandler = {if(SC_PvE)then{if (isPlayer cursorTarget)then {deleteVehicle(_this select 6)};}};

 

because i try it without that line & script didn't work :(

 

 

i try the new update for SIM script its work without problem :)

 

 

Thx

Link to comment
Share on other sites

@hakimos00: thanks for that! I tend to forget those tiny details because I have been extremely busy lately with updating and releasing :)

The instructions for adding the EH Fired exception in the run.sqf has been added to infiSTARsettings.txt.

Link to comment
Share on other sites

Hi, I have a PvE server with 3 PvP Zones, is it actually possible to say have 3 exclusion zones to your anti pvp script, I know nothing about creating all these great script so just a question.

 

Many thanks

 

simon

 

Hi Simon,

Yes that would be possible. Just give me the names of the triggers you have and I'll patch it for you.

Link to comment
Share on other sites

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
×
×
  • Create New...