English LUA SCRIPT- for competitive mode

30 replies
Goto Page
To the start Previous 1 2 Next To the start
Up
Andrez
User
Offline Off
Image:IMG:http://www.unrealsoftware.de/u_scr/u1e45_50e0229cs1.jpg?t=0



What about doing "something similar"


:Aim a teammate at the start of the round, and you will see his money, it would be usefull for competitive mode


http://www.unrealsoftware.de/files_show.php?file=12945&goto=182401#com182401

Edited with new idea:comments
edited 1×, last 18.11.15 05:57:08 am
∗ PCS ADMIN CS2D.NET - Clan: Storm . Cs2d competitive videos:Andréz
17.11.15 01:47:32 am
Up
Rainoth
Moderator
Offline Off
• On round start for 15 seconds request client data
• check if a person is on the tile you're aiming at
• if there's a person, display his name and money

Can be written in a few minutes but I'm afraid I don't have them right now.
17.11.15 04:18:38 am
Up
Andrez
User
Offline Off
Im requesting this for PCS svs( used for mixes, clanwars, tournaments)
∗ PCS ADMIN CS2D.NET - Clan: Storm . Cs2d competitive videos:Andréz
17.11.15 10:32:36 am
Up
Gaios
Security Supporter
Offline Off
I can make it for you after school. Also it will be visible only for alive players.
17.11.15 11:04:35 am
Up
Yates
Reviewer
Offline Off
Let's lag some competitive servers! Because that is what you are going to do.

I suggest you not request client data to eventually end up only asking for player information. If you really want that on hover thing, I suggest you trigger the requiring of the data with E or something else. Otherwise client data will be requested every millisecond or second, which lags.
17.11.15 12:40:01 pm
Up
Gaios
Security Supporter
Offline Off
@user Yates: You don't know how pro I am. I know a lot about CS2D engine and know how to do without any lags.
user Andrez has written:
a teammate at the start of the round, and you will see his money
17.11.15 01:27:28 pm
Up
Yates
Reviewer
Offline Off
Requesting client data will always cause lag when requesting every 100th millisecond or second for each alive player. You can only limit the requests which will help, but can not simply be requested on the hover over a player. To make this work how the OP wants it it would require at most the request of data each time the ms100 hook is triggered to make it look smooth, but then you are requesting client data 10 times every second per player and you don't always use it because you are not hovering over the player every 100th millisecond, and this player can also be on the enemy team. So basically you are wasting data resources for no reason.

There is no other way around this problem to make it work as smooth as the OP obviously wants it. Unless you have a magical way to request player data with serious refined mechanisms without using the cs2d lua cmd reqcld (which is the only current way to get the mouse position) then go ahead and show us all.

You also have to take into account that you cannot use the second hook, as players move. So if you hover over the person and that person moves and you do not follow him with your mouse you are also wasting resources.

All I can say is go ahead and prove me wrong, but until that happens I seriously suggest the requesting of data be triggered with another hook for example cs2d lua hook use or cs2d lua hook serveraction
edited 2×, last 17.11.15 01:43:35 pm
17.11.15 03:02:59 pm
Up
Bowlinghead
User
Offline Off
You dont have to use reqcld all the time.
You can use player(id,"rot") to check in which direction a player aims at.
If a player aims at the direction where another player stands then you have to request client data.
Share time limited free games here
17.11.15 03:17:35 pm
Up
Yates
Reviewer
Offline Off
Good luck getting that to work properly.
17.11.15 04:04:45 pm
Up
Gaios
Security Supporter
Offline Off
No lags, no mad.
This only works when freeze timer is set to minimum: 2.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
------------------------------------------
-- Show Money for PCS by Gajos (#18271) --
------------------------------------------

gajos = {}
gajos.huds = {}
for i = 1,32 do
     gajos.huds[i] = {}
end
addhook('startround','gajos.startround',42)
function gajos.startround()
     local freezeTime = tonumber(game('mp_freezetime')) or 0
     if freezeTime > 1 then
          gajos.tableLiving = player(0,'tableliving')
          for _, id in pairs(gajos.tableLiving) do
               for _, pl in pairs(gajos.tableLiving) do
                    if player(id,'health') > 0 and player(pl,'health') and player(id,'team') == player(pl,'team') and id ~= pl then
                         updateHudtxt(id,pl,x,y)
                         table.insert(gajos.huds[id],pl)
                    end
               end
          end
          addhook('buy','gajos.buy',42)
          timer((freezeTime - 1) * 1000,'removeHudtxts')
     end
end

function gajos.buy(pl)
     for _, id in pairs(gajos.tableLiving) do
          if player(id,'team') == player(pl,'team') and id ~= pl then
               timer(50,'parse','lua updateHudtxt('..id..','..pl..')')
          end
     end
end

function updateHudtxt(id,pl)
     local x, y = player(pl,'x') - player(id,'x') + 320, player(pl,'y') - player(id,'y') + 200
     parse('hudtxt2 '..id..' '..pl..' "©000255000$'..player(pl,'money')..'" '..x..' '..y..' 1')
end

function removeHudtxts()
     freehook('buy','gajos.buy')
     for _, id in pairs(gajos.tableLiving) do
          for k, i in pairs(gajos.huds[id]) do
               parse('hudtxtalphafade '..id..' '..i..' 1000 0')
          end
          gajos.huds[id] = {}
     end
     gajos.tableLiving = nil
end

IMG:http://i.imgur.com/mEnIfEk.jpg
17.11.15 04:09:09 pm
Up
Yates
Reviewer
Offline Off
Uh, obviously your ignorance to read can be seen here. The OP wanted an "on hover show that player's money."

I mean dude, it's the only actual sentence he has in his first post which isn't even a line long:
Quote:
:Aim a teammate at the start of the round, and you will see his money




Less talk, more read.
17.11.15 04:10:36 pm
Up
Gaios
Security Supporter
Offline Off
@user Yates: I knew that, but I wouldn't do that. Anyway there we can just do freehook ms100. No lags.
17.11.15 04:13:31 pm
Up
Yates
Reviewer
Offline Off
I only said it would lag with the cs2d lua cmd reqcld when used as an "on hover" state over a player.

You have basically proven nothing. Way to go, Gajos.

Quote:
I knew that, but I wouldn't do that.

With this attitude you are going nowhere. A client want what a client wants. You cannot do this in a business environment.
17.11.15 08:00:57 pm
Up
Andrez
User
Offline Off
Thank you guys, at the moment i will check the script that GajosPL made, if it lags then...

It's working on PCS Mix miami sv right now
∗ PCS ADMIN CS2D.NET - Clan: Storm . Cs2d competitive videos:Andréz
17.11.15 08:52:39 pm
Up
Gaios
Security Supporter
Offline Off
@user Andrez: There can't be lags with my script.
17.11.15 09:03:17 pm
Up
Ty for the script. I'll add it to the CS2DBR's mix (competitive) server
CS2D Brazilian Community - http://cs2dbr.tk
18.11.15 05:56:01 am
Up
Andrez
User
Offline Off
Btw, some players use the same hitsound, that's been spread for years.

Is there a way to detect that single file and auto bust them when they join my sv?

Atleast they would have to edit their sfx(ye probably volume increase or someshit), or get a new hitsound

It's not very easy to bust them, they have to make hard mistakes like this one from today

https://www.youtube.com/watch?v=jdASGxrZtq0&feature=youtu.be
∗ PCS ADMIN CS2D.NET - Clan: Storm . Cs2d competitive videos:Andréz
18.11.15 05:51:36 pm
Up
Milriko
User
Offline Off
Actually what Gajos did here is much better and easier for team communication. Now we don't have to use longer freezetime period to hove on everyone and see the money. Freezetime can remain the same as it was (5 or 7 seconds) and the decission about full/eco can be declared after 1/2 seconds, allowing us to have also some tactic seconds or to take notes for rounds etc.
Thanks Gajos, i think it will be used in next tournament (atleast i hope so).

That would be awesome to detect sfx for hits, because that's one of the few things our AC can't detect (well it can, but not always) and hitsounds can be a big advantage for cheaters (for competetive gaming using hitsounds is cheating already :P).

I actually never thought of such lua that Gajos did here in probably few minutes, so simple, clever and useful.
IMG:http://imgupload.pl/images/46791184149161885069.png
18.11.15 08:05:52 pm
Up
Andrez
User
Offline Off
Or maybe it would be easier to just detect modifications in the single file that comes in the cs2d.com version, it would just tell me, with my admin panel that the players has hitsounds, the idea is probably to bust them before they even notice

For example, moss uses this

D:\2d\sfx\player\hit1.wav md5: 1ff855e59dc1d55fbdd899b3734bf65747078f41738b7ebdb1e6fdda54298e6b
D:\2d\sfx\player\hit2.wav md5: bb2b7393b580220df80966a5d4ed89c1f4eaa7e0d4690f27221e9dc021c4d9f2
D:\2d\sfx\player\hit3.wav md5: ebabd453fd91ef46f4067720bedf2ff51140e1d0f9f5cafd29c530c29bfddd4a


Those are the values for the cs2d.com version of the hitsounds
edited 1×, last 18.11.15 08:36:58 pm
∗ PCS ADMIN CS2D.NET - Clan: Storm . Cs2d competitive videos:Andréz
18.11.15 08:45:42 pm
Up
Gaios
Security Supporter
Offline Off
I don't know MOSS and can't comment on that. Maybe what you said is good, but I don't know. Lua Simply can't detect the sounds.

If you have any ideas to improve my script, say.
To the start Previous 1 2 Next To the start