Forum

> > CS2D > Scripts > Prevent a player from attacking.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Prevent a player from attacking.

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Prevent a player from attacking.

Mami Tomoe
User Off Offline

Zitieren
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?

alt Re: Prevent a player from attacking.

GeoB99
Moderator Off Offline

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

alt Re: Prevent a player from attacking.

Talented Doge
User Off Offline

Zitieren
Zitat
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht