Liberty Unleashed

Scripting => Script Help => Topic started by: Ahmed Abouelnas on July 28, 2013, 09:31:57 pm

Title: get team
Post by: Ahmed Abouelnas 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;
}
Title: Re: get team
Post by: Mido_Pop 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;
}
Title: Re: get team
Post by: Ahmed Abouelnas 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
Title: Re: get team
Post by: Mido_Pop 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
Title: Re: get team
Post by: Ahmed Abouelnas 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
Title: Re: get team
Post by: Ahmed Abouelnas 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