Help, please! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help, please! (
/showthread.php?tid=276192)
Help, please! -
Setkus - 12.08.2011
Hey, guys!
This time I want to ask you about players and how show them when they connect. Well, for example player connects and choose team green and in the left of the screen shows for all players Green team players: (shows green team players) and little lower shows blue team players. Well, i hope you understand me. Sorry for my bad english, i'm Lithuanian! And thanks for all who helping me! In this site are very helpful people!
Re: Help, please! -
Raimis_R - 12.08.2011
At first you need to create TextDraw then you can make variable like:
when player choose blue team add to variable ++
when green
And then you can update TextDraw this its very easy!
And sure! when player disconnected you need subtract -1 from variable = Update TextDraw.
Kapys?
Re: Help, please! -
Setkus - 12.08.2011
Not much. Can you give me an example?
Re: Help, please! -
Raimis_R - 12.08.2011
pawn Код:
static
TeamCounts[ 2 ],
Team[ MAX_PLAYERS ]; // 2 Teams 0 - Red, 1 GREEN.
public OnPlayerRequestClass( playerid, classid )
{
if ( classid == 14 ) // For Example
{
TeamCounts[ 0 ]++; // In Red TM 1 player more!
Team[ playerid ] = 1; // Set Player Team In Variable.
// Now you can update TextDraw.
}
else
{
TeamCounts[ 0 ]++; // In Green TM 1 player more!
Team[ playerid ] = 2; // Set Player Team In Variable.
// Now you can update TextDraw.
}
return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
if ( Team[ playerid ] == 1 )
TeamCounts[ 0 ]--;
else
TeamCounts[ 1 ]--;
// Subtract -1 now you can update TextDraw
return 1;
}
Sorry for spacing, this its my style.