Forum

> > CS2D > Scripts > LUA: Get a player's current clip and ammo?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch LUA: Get a player's current clip and ammo?

1 Antwort
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt LUA: Get a player's current clip and ammo?

sebastiannielsen
User Off Offline

Zitieren
How can I in lua, get ammo in current clip, and ammo in "backpack" for the weapon the player is currently holding?
Guess its something like player(id,"something") but cant find something like that in manual.

Tried with player(id,"reloading") but that was apparently a boolean value and not ammo.

alt Re: LUA: Get a player's current clip and ammo?

DC
Admin Off Offline

Zitieren
you actually can't get those values because the server isn't aware of the accurate ammo values.
the server only knows the maximum possible ammo amount a player still can have (based on the shoot-packets that arrived at the server) but the actual ammo value can differ (be slightly lower) in case a shoot-packet got lost. that's why these values are not revealed to the Lua scripting interface.

(in case a weapon is dropped the client determines the ammo which is in the dropped weapon. the server just checks if this value is lower or equal to the maximum possible ammo to make ammo hacks impossible)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht