Caged players -
Ananisiki - 27.02.2014
~~~~~~~~
Re: Caged players -
Jimmy0wns - 27.02.2014
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.
Re: Caged players -
Ananisiki - 27.02.2014
Example?
Re: Caged players -
Jimmy0wns - 27.02.2014
Quote:
Originally Posted by Ananisiki
Example? 
|
Well, for the variable, +1 and -1 you'll have to make a variable ofcourse.
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.
Re: Caged players -
Ananisiki - 27.02.2014
Also, will it add ~y~2 etc automatically?
Re: Caged players -
Jimmy0wns - 27.02.2014
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.
Re: Caged players -
Ananisiki - 27.02.2014
Thats the stuff i need help with ;o
Re: Caged players -
Jimmy0wns - 27.02.2014
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]);
}
Re: Caged players -
Ananisiki - 27.02.2014
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);
}
Re: Caged players -
Ananisiki - 01.03.2014
Bump