English Count players and if?

31 replies
Goto Page
To the start Previous 1 2 Next To the start
26.01.18 09:31:31 pm
Up
Gaios
Security Supporter
Offline Off
user script favor has written:
I send him the script on pm and stop flame , fucking kiddy.

Oh yeah, for sure
26.01.18 09:31:34 pm
Up
Masea
Super User
Offline Off
Sir, your condition is going to be everytime true since there's no way someone dies on an empty server. So that would change nothing across the current code if we had added it. I'm quite sure that you tried to tell the issue wrongly.

user script favor has written:
tested worked
Code:
1
2
3
4
5
6
7
8
9
10
11
function zp_die(p)
local t = player(p,'team')
for i = 1,1 do
if t == 2 then
parse('maket '..p)
     end
end
     zp_hudtxt2(p,2,1,'',0,0,0)
     zp_hudtxt2(p,4,1,'',0,0,0)
     return 1
end


Goodluck.
First learn Lua and then maybe you can say "Good luck" to others.
Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery: file cs2d Outlast II Modification (28)
26.01.18 09:57:46 pm
Up
script favor
User
Offline Off
@user Masea: But you you did only comment on my post ?
Stop it :).
I know what ur trying to do mate :D.
26.01.18 10:09:20 pm
Up
LAMIALJE
User
Offline Off
this thread is transforming into hatred for people
What the F.A.Q.?| ∗ faqduLLAH
26.01.18 11:28:44 pm
Up
Yates
Reviewer
Offline Off
user script favor has written:
I send him the script on pm and stop flame , fucking kiddy.

I would be delighted to know what code you cooked up judging your previous attempts.

Please enlighten us all oh glorious adult.
27.01.18 12:22:40 am
Up
LAMIALJE
User
Offline Off
@user Yates: What previous attempts?
What the F.A.Q.?| ∗ faqduLLAH
27.01.18 05:24:06 am
Up
Waldin
User
Offline Off
before learning lua learn english (im saying this to me too)
user Waldin (2014) has written:
can be create 3D option for tiles on 3D
user DC (2014) has written:
@user Waldin: This is a 2D game. there are no 3D tiles.
changelog (2017) has written:
ADDED Experimental 3D rendering mode
27.01.18 02:13:22 pm
Up
DC
Admin
Offline Off
@user script favor: What other people here are trying to say is that you shouldn't try to help others if you're not sure what you're doing.

It's nice that you're trying to help but your attempts are misleading and no proper solution. This way you're only confusing others. So what you're actually doing is not helping but confusing people with wrong and weird "solutions". Which is a bad thing. In this case it would be better to not contribute at all - or to at least try to describe your attempt so people understand your thoughts and can help.

Moreover sending thread related content via PM is a very bad practice because you hide information from public this way. This renders the forum entirely useless and therefore it should never be done. The point is to share knowledge, not to hide it by using PMs.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
27.01.18 04:25:49 pm
Up
Talented Doge
User
Offline Off
Everyone here thinks of using the for loop to count players, which is in fact in effective. The savior of this is to use the next function. The solution is as follows:

Code:
1
2
3
4
5
6
7
8
function zp_die(p)
     if player(p, "team") == 2 and next(player(0, "tableliving"), 1) then
          parse('maket '..p)
     end
    zp_hudtxt2(p,2,1,'',0,0,0)
    zp_hudtxt2(p,4,1,'',0,0,0)
    return 1
end


If you want to check overall players(including dead ones and spectators), simply change tableliving to table.
Talented Doge
27.01.18 04:52:27 pm
Up
Baloon
GAME BANNED
Offline Off
Is
#player(0,"tableliving")
actually works?
28.01.18 04:22:02 am
Up
VADemon
User
Offline Off
@user Baloon: Yes. This is how the table returned by player(0, ...) looks:
{
[1] = playerID1,
[2] = playerID7,
[3] = playerID13,
[4] = playerID25,
}

#player(0,"tableliving") is 4 when 4 players are alive.
29.01.18 08:11:33 am
Up
Gaios
Security Supporter
Offline Off
user Gaios has written:
What is
count
? A variable or count of players in-game?

This ^

Maybe he wants in-game players, or just alive. He didn't answer yet.
To the start Previous 1 2 Next To the start