Jump to content
relisek

Teleport everyone when fired!

Recommended Posts

Hello, i'm a beginner in scripting, just gaving myself some stuff for training and im struggling with this one,

 

_unitwep = player;
bulletinair = false;
bulletinairpos = [];

_unitwep addeventhandler ["Fired",   
{ 
 _this spawn  {
	_unit = player;
	if (!bulletinair) then {
	bulletinair = true;
	_bullet = _this select 6; 
	_pos = getPosATL _bullet;
	while {alive _bullet} do {_pos = getPosATL _bullet; bulletinairpos = getposATL _bullet};
	_roundpos = [(round (_pos select 0)),(round (_pos select 1)),(round (getposATL _bullet select 2))];
	_null = (_pos select 0) + (_pos select 1) + (_pos select 2);
	if (_null == 0) then {hint format ["Error: pos = %1",_pos]} else {_unit setpos [_pos select 0, _pos select 1,0.5]; hint format ["Teleported to: %1",_roundpos]};
	waitUntil {!alive _bullet};
	bulletinair = false;
	bulletinairpos = [];
	} else {hint format ["Wait for bullet to hit the ground, its %1M from the ground",(round (bulletinairpos select 2))]};
 }; 
}];

 

It teleports you where ever you shoot, the problem is i just dont know how to rebuild it so it will teleport everyone where i shoot and it doesnt mean the bullet has to land, i was thinking about such a sleep like 0.5 after i shoot there all players would be telerported including me. Its just for training purpose, i tried myself to remake it with no success

Share this post


Link to post
Share on other sites
10 hours ago, pierremgi said:

What for? More cheat codes on servers?

If you have nothing to add or don't agree with the motives then don't reply. Let us try to keep this a friendly and welcoming forum.

 

17 hours ago, relisek said:

It teleports you where ever you shoot, the problem is i just dont know how to rebuild it so it will teleport everyone where i shoot and it doesnt mean the bullet has to land, i was thinking about such a sleep like 0.5 after i shoot there all players would be telerported including me. Its just for training purpose, i tried myself to remake it with no success

Teleporting is just using a command like setPos on an object. Teleporting several objects is just using the same command on several objects.

 

A good place to start to look is the commands forEach and allPlayers. With that you should have everything you need. 

 

As you say you are learning here's a couple of tips:

1. You should bookmark the scripting commands page on the biki. You will be looking at it alot.

 

2. Get a good text editor, preferably one that has sqf support. I prefer VS Code but to each his own.

 

3. Have fun, take on interesting challenges and try cool ideas. Experiment and be curious. 

 

4. Give credit where credit is due.

  • Like 3

Share this post


Link to post
Share on other sites
25 minutes ago, mrcurry said:

If you have nothing to add or don't agree with the motives then don't reply. Let us try to keep this a friendly and welcoming forum.

New forum account, and the very first post asking how to teleport people at the cursor position he's shooting at.

Should at least raise an eyebrow, no?

 

Cheers

  • Like 7

Share this post


Link to post
Share on other sites
1 hour ago, Grumpy Old Man said:

New forum account, and the very first post asking how to teleport people at the cursor position he's shooting at.

Should at least raise an eyebrow, no?

 

Cheers

This is how I see it.

 

Either he's trying to cheat or he's honestly trying to learn.

 

If he's out to cheat and I treat him like crap I really don't achieve anything. The information is out there and if I'm not going to help him he will likely just turn elsewhere. It is unlikely I will discourage him with a figurative "No!" at the door. 

 

If he's trying to cheat and I treat him well, well what's the harm? There are other systems in place to prevent unwarranted changes of game mechanisms. If I suspect he's up to no good I can also make it more effort than is worthwhile and he might lose interest.

 

If he's trying to learn and I treat him like crap I've likely discouraged him from scripting entirely which, in my book at least, is detrimental. I've also stained the reputation of the community. 

 

If he's trying learn and I treat him well, well everybody wins don't they?

 

So by all means raise an eyebrow or even two but I do believe those eyebrows should be kept out of the replies or at least be hidden by a smile.

 

As a side note: When someone claims to be new I believe it better to just give pointers instead of pasting code solutions. It's more work but gives better result.

  • Like 4

Share this post


Link to post
Share on other sites

thats kind of responds i expected, thats a shame you assuming im cheating, i just make myself a goal and that's the one i want to shoot and tp people where i shoot

  • Haha 1

Share this post


Link to post
Share on other sites
47 minutes ago, relisek said:

thats kind of responds i expected, thats a shame you assuming im cheating, i just make myself a goal and that's the one i want to shoot and tp people where i shoot

did u read ur own thread? and did you understand the discussion in there?

 

Now after your last statement I'm mostly sure that you are a cheater but I agree with @mrcurry what do we loose? Nothing!

 

@relisekTherefore don't cry and ask your questions. Learn scripting and get part of this kind community. Or if the only thing you are actually able to do in this forum is crying about other peoples opinion then leave please. 

  • Like 1

Share this post


Link to post
Share on other sites
13 hours ago, relisek said:

thats kind of responds i expected, thats a shame you assuming im cheating, i just make myself a goal and that's the one i want to shoot and tp people where i shoot

I'm going to reiterate that my first post contains all the parts needed to solve this. If the code you posted is yours then you should have little to no trouble to convert it using the information I gave in my first post.

  • Like 2
  • Confused 1

Share this post


Link to post
Share on other sites
6 hours ago, mrcurry said:

I'm going to reiterate that my first post contains all the parts needed to solve this. If the code you posted is yours then you should have little to no trouble to convert it using the information I gave in my first post.

 

Really? This code will fail for multiple reasons, some of them very basic ones, but I persist to say that the intent to teleport all players in a MP server, shooting at somewhere, is just weird. Furthermore, there is no explanation about this aim. Not mandatory? fine...

As you know, Warlord servers suffer for plenty of cheaters, killing the game, day after day (see Warlord forum). Personally, I'll not take the risk to feed this kind of behavior. That's my point of view and the reason why I ask the initial question.

There is nothing wrong about the chart. On the contrary! Just remember that you are here on a public forum, with different feelings, different point of view and, first of all, anybody can read and profit of what you're writing. If you consider that relisek is clean, what about some future readers?

So, on my mind, the question here is less "how can I help for a cheat code?" than "who will read this cheat code?"

If you agree with that, I simply suggest you to continue helping relisek by PM.

 

  • Like 2

Share this post


Link to post
Share on other sites
49 minutes ago, pierremgi said:

If you consider that relisek is clean

With a unique name like that it's a matter of 2-3 minutes to find out if the same user name shows up on the typical cheating forums, selling altis life money, gta v cash etc.

Would be quite a coincidence, heh.

 

Cheers

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
14 hours ago, Grumpy Old Man said:

With a unique name like that

Yeah I've heard enough.

 

Cheating/Hacking violates our Forum rules. If you continue, your forum access will be restricted.

 

Closing.

  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×