Caged players
#1

~~~~~~~~
Reply
#2

Make a variable and make it +1 every time a player gets caged and -1 when a player gets uncaged, then check how many players are caged and the rest is up to you.
Reply
#3

Example?
Reply
#4

Quote:
Originally Posted by Ananisiki
Посмотреть сообщение
Example?
Well, for the variable, +1 and -1 you'll have to make a variable ofcourse.
pawn Код:
new playerscaged;
And when players are getting caged or uncaged you'll have to use this:
pawn Код:
playerscaged += 1; // player caged
playerscaged -+ 1; // uncaged
I can't exactly remember how the -- works, probably is something like +- or -+, but yea as said, try to do the rest yourself.

EDIT: remembered how it works again lol, edited.
Reply
#5

Also, will it add ~y~2 etc automatically?
Reply
#6

Quote:
Originally Posted by Ananisiki
Посмотреть сообщение
Also, will it add ~y~2 etc automatically?
nope, you need to check how many players are caged and which players are caged.
Reply
#7

Thats the stuff i need help with ;o
Reply
#8

Quote:
Originally Posted by Ananisiki
Посмотреть сообщение
Thats the stuff i need help with ;o
Well, you already got most of it, but now check if there are any players, if yes, create the textdraw.
I'm sure there's an easier way for this but here's what i was thinking of:
pawn Код:
if(playerscaged == 1)
    {
        format(string, sizeof string, "~y~1 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText3[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText0[playerid]);
    }
    if(playerscaged == 2)
    {
        format(string, sizeof string, "~y~2 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText4[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText1[playerid]);
    }
    if(playerscaged == 3)
    {
        format(string, sizeof string, "~y~3 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText5[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText2[playerid]);
    }
    if(playerscaged == 4)
    {
        format(string, sizeof string, "~y~4 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText6[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText3[playerid]);
    }
    if(playerscaged == 5)
    {
        format(string, sizeof string, "~y~5 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText7[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText4[playerid]);
    }
    if(playerscaged == 6)
    {
        format(string, sizeof string, "~y~6 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText8[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText5[playerid]);
    }
    if(playerscaged == 7)
    {
        format(string, sizeof string, "~y~7 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText9[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText6[playerid]);
    }
    if(playerscaged == 8)
    {
        format(string, sizeof string, "~y~8 ~w~- %s (%d)", PlayerName(i), i);
        TextDrawSetString(CagedText10[playerid], string);
        TextDrawShowForPlayer(playerid, CagedText7[playerid]);
    }
Reply
#9

If i cage player one, it shows up, if i cage another player, player number two's name gets overlayed with that one, it doesn't make a new line..

pawn Код:
if(Caged[i] == 1)
                {
                    format(string, sizeof string, "~y~1 ~w~- %s (%d)", PlayerName(i), i);
                    TextDrawSetString(CagedText3[playerid], string);
                }
                if(Caged[i] == 2)
                {
                    format(string, sizeof string, "~y~2 ~w~- %s (%d)", PlayerName(i), i);
                    TextDrawSetString(CagedText4[playerid], string);
                }
Reply
#10

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)