Author Topic: get team  (Read 1741 times)

Ahmed Abouelnas

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-11
  • Ahmed Abouelnas
    • View Profile
get team
« on: July 28, 2013, 09:31:57 pm »
how to get the players names which in team 1

Code: [Select]
function onPlayerCommand( pPlayer, szCommand, szText )
{
if ( szCommand == "team1" )
{
Message( "The team no. 1 has - " + Team=1 );
}

return 1;
}

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: get team
« Reply #1 on: July 28, 2013, 11:48:29 pm »
how to get the players names which in team 1

Code: [Select]
function onPlayerCommand( pPlayer, szCommand, szText )
{
if ( szCommand == "team1" )
{
Message( "The team no. 1 has - " + Team=1 );
}

return 1;
}

I Can't Understand You But Try This >>
Code: [Select]
function onPlayerCommand( pPlayer, szCommand, szText )
{
if ( szCommand == "team1" )
{
             if ( pPlayer.Team == 1 )
              {
Message( ""+pPlayer.Name+" In The ( 1 ) Team. );
              }
}

return 1;
}



Ahmed Abouelnas

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-11
  • Ahmed Abouelnas
    • View Profile
Re: get team
« Reply #2 on: July 29, 2013, 12:39:52 am »
what i mean when i command team1 message appear to me with all players in team 1
and when i command team2 message appear to me with all players in team 2
that's all

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: get team
« Reply #3 on: July 29, 2013, 12:51:45 am »
what i mean when i command team1 message appear to me with all players in team 1
and when i command team2 message appear to me with all players in team 2
that's all
Bos Ana Mesh Fahem Awy Fahmny Bl 3raby 3lshan Afham Akter



Ahmed Abouelnas

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-11
  • Ahmed Abouelnas
    • View Profile
Re: get team
« Reply #4 on: July 29, 2013, 01:17:19 am »
what i mean when i command team1 message appear to me with all players in team 1
and when i command team2 message appear to me with all players in team 2
that's all
Bos Ana Mesh Fahem Awy Fahmny Bl 3raby 3lshan Afham Akter
bos lma aktob /te1 by5leeny fe team 1
ana 3ayz lma aktob /team1 yktbly message feha meen ely mawgood fe team 1

Ahmed Abouelnas

  • Newbie
  • *
  • Posts: 39
  • Karma: +2/-11
  • Ahmed Abouelnas
    • View Profile
Re: get team
« Reply #5 on: July 30, 2013, 02:53:09 pm »
Solved

Code: [Select]
function onPlayerCommand( pPlayer, szCommand, szText )
{
if ( szCommand == "team1" )
{
Message( "Team 1 Players:" );

local x = 0
while ( x < GetPlayers() )
{
local plr = FindPlayer( x );

if ( plr )
{
if ( plr.Team == 1 )
{
Message( plr.Name );
}
}
x++;
}
}

return 1;
}
function GetPlayer( target )
{
target = target.tostring();

if ( IsNum( target ) )
{
target = target.tointeger();

if ( FindPlayer( target ) ) return FindPlayer( target );
else return null;
}
else if ( FindPlayer( target ) ) return FindPlayer( target );
else return null;
}

Topic Locked

 

© Liberty Unleashed Team.