Forum

> > CS2D > Scripts > Prevent a player from attacking.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Prevent a player from attacking.

4 replies
To the start Previous 1 Next To the start

old Prevent a player from attacking.

Mami Tomoe
User Off Offline

Quote
Hello there!

I've tried to find a way to prevent a player from shooting (at all).
That means when he presses the [attack] key nothing will happen no matter what he has equipped, what I've successfully done is preventing the player from damaging buildings and players.
The player still loses ammo though...
Is there a way to do this?

old Re: Prevent a player from attacking.

GeoB99
Moderator Off Offline

Quote
Attacking is a client-sided effect which means that when you're shooting an enemy player, a network packet will be sent to the server and the server has to check the following conditions if you've hit the player or not.

If there was such a way to prevent a player from attacking then an additional delay has to be expected and that would result in a pretty bad gameplay and nuisance. In other words, it is impossible to do that by Lua scripting means.

old Re: Prevent a player from attacking.

Talented Doge
User Off Offline

Quote
Quote
Oh, is there a way to prevent the player from losing ammo?


No.

But you can prevent a player from attacking by making their ammo 0. And when they do not attack, make their gun full ammo again.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview