[Flashy] Show with TextDraw a Kill counter
#1

Hello all!

I have a little problem with TextDraw and SetTimer. I have already make a TextDraw. But now I need a Timer that shows how many players are still alive.

Like:

Triads: 10
Rifas: 10

10 = Players alive

And the counter must go down. So I have already make a TextDraw. I just need a Counter.

TextDraw: http://pastebin.com/neA2V3WJ
Reply
#2

Common help me xD
Reply
#3

Thanks, but what do you mean with the variable must be 0 or 1 ? What is the differents?

And yes I want to know about this, I donґt get it xD
Reply
#4

new TeamKills[2];

creates an array with two cells. In the first cell you would store the number of players left in the first team, in the second cell you would store the one in the second team.

Array-cells start with 0. If you create an array of two cells you have a variable TeamKills[0] and a variable TeamKills[1].

Hence if someone of Team 1 dies, you decrement TeamKills[0] by one (TeamKills[0]--, if someone of team 2 dies you decrement TeamKills[1] by one.

To avoid confusion I'd also suggest you do not call the array TeamKills.
Reply
#5

Oh wtf xD I understand nothing xD

If someone can put this in the script I would be very grateful:

http://pastebin.com/b4GaCX5w
Reply
#6

I rather try helping you getting it done on your own than giving you finished code, so you don't need to ask again if you want to script something that easy again.

You have a perfect and easy-to-understand explanation of what an array is right here:

https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays

To achieve what you want to have, you create an array with two cells storing the number of players of each team in those two cells.

Whenever a player dies, you check his team and depending in which team he's been you decrement the respective array cell by one (subtract one).

That's really all you need to know, anything else can be read from documentary.

Now try scripting it yourself and if you run into specific problems, post here again.
Reply
#7

I have do all things what I know but I really donґt get it ґwhy I need arrays for a kill counter next to TextDraw.

The best thing someone script нt for me. It isnґt to much and then I know exactly what I have to do.

In this way, when you explain me that, I never will found it.
Reply
#8

I dunno if itґs this what you want but I have do this:

http://pastebin.com/GM9MW98Y
Reply
#9

...
Reply
#10

You need a variable in which you store how many people are killed from each team.

Whether you do this with an two cells array or two seperate variables is up to you. If you don't want to use an array simply declare:

new team_rifa_alive=10; // or with whatever number of players the team starts
new team_triad_alive; // " "

and just store in those how many people are still alive (meaning each time a player of one team dies the respective variable gets decremented by one:

Either team_rifa_alive--; or team_rifa_alive=team_rifa_alive-1; which do technically the same.

As I said, I don't ask you to do "all things you know" - I ask you to read this short text I gave you instead of asking for final code as next time you want to have something like that scripted, you won't need to ask in here anymore, but be able to do it on your own.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)