beginning
[pawn]new TEAM[MAX_PLAYERS];
new REQUEST[MAX_PLAYERS];
new DENY[MAX_PLAYERS];[/pawn]
now in onplayerspawn when team-mate spawn he got spawn to you
[pawn]new plr;
new Float:x, Float:y, Float:z;
if(TEAM[playerid] == 1 || TEAM[ plr ] == 1 ) {
GetPlayerPos( plr, x, y, z );
SetPlayerPos( playerid, x, y + 1.0, z, 0, 0 );
}[/pawn]
now cmds
[pawn] else if ( strcmp( cmd, "!team", true ) == 0 )
{
new plr;
tmp = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREY, "Usage: !team [Nick/ID]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else if(TEAM[ plr ] == 1) SendClientMessage(playerid, GREEN," Player Is ALready In A Team");
else
{
SendClientMessage(plr, RED, " Player Wants To Team WIth You do /c accept or deny");
REQUEST[ plr ] = 1;
}
return 1;
}
else if ( strcmp( cmd, "!leaveteam", true ) == 0 )
{
new plr;
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if(REQUEST[playerid] == 0) SendClientMessage(playerid, GREEN," You are not in any team");
else
{
SendClientMessage(plr, RED, " Player Dont Want TO Team With You ANyMore");
TEAM[ plr ] = 0;
}
return 1;
}
else if ( strcmp( cmd, "!accept", true ) == 0 )
{
new plr;
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if(REQUEST[playerid] == 0) SendClientMessage(playerid, GREEN," You DOnt Have A Request");
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else
{
SendClientMessage(plr, RED, " You ARe Now In Team");
TEAM[ plr ] = 1;
TEAM[ playerid ] = 1;
GetPlayerPos( plr, x, y, z );
SetPlayerPos( playerid, x, y + 1.0, z, 0, 0 );
}
return 1;
}
else if ( strcmp( cmd, "!deny", true ) == 0 )
{
new plr;
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if(REQUEST[playerid] == 0) SendClientMessage(playerid, GREEN," You DOnt Have A Request");
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else
{
SendClientMessage(plr, RED, " You ARe Not In Team");
TEAM[ plr ] = 0;
TEAM[ playerid ] = 0;
DENY[ playerid ] = 1;
DENY[ plr ] = 1;
}
return 1;
}[/pawn]
CREDITS = SPIDER
SAW A BUG FEEL FREE TO POST