Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on March 12, 2013, 06:19:09 pm

Title: [SNIPPET]Team System Full ANd Final By Me
Post by: mrockxkingbutt on March 12, 2013, 06:19:09 pm
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


Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: VC[88]PD on March 13, 2013, 11:42:22 am
SendClientMessage(plr, RED, " Player Wants To Team WIth You do /c accept or deny");
should be
SendClientMessage(plr, RED, " Player Wants To Team WIth You do !accept or deny");
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: mrockxkingbutt on March 13, 2013, 11:51:33 am
i change it
sorry
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: VC[88]PD on March 13, 2013, 12:39:29 pm
ok,it's a good cmd
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: mrockxkingbutt on March 13, 2013, 12:52:27 pm
THANKS MEN
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: Fuzzy168 on March 13, 2013, 04:44:01 pm
NOOOOO.. Not another GUPS SNIPPET..  >:(
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: Doom on March 13, 2013, 05:04:19 pm
NOOOOO.. Not another GUPS SNIPPET..  >:(

He always Fails...  :-\  ;)
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: mrockxkingbutt on March 13, 2013, 05:11:34 pm
wtf this is for each servers just you need the correct include :P
fuzzie and doom
you never think to do this
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: USA.Ghost on March 15, 2013, 08:43:46 am
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] != 255) {
      while (TEAM[ plr ] == playerid  ) {
      plr++
}
while (TEAM[ plr ] != playerid ) {
GetPlayerPos(plr, x, y, z);
SetPlayerPos(playerid, x, y, 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 ] != 255) 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 ] = 255;
TEAM[ playerid ] = 255;
 }
      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 ] = playerid;
TEAM[ playerid ] = plr;
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 ] = 255;
TEAM[ playerid ] = 255;
DENY[ playerid ] = 1;
DENY[ plr ] = 1;
 }
      return 1;
   }[/pawn]

CREDITS = SPIDER(MAIN IDEA) AND USA.GHOST(FIX BUG TO ONLY WORK WITH PLAYERID 0)

SAW A BUG FEEL FREE TO POST
Title: Re: [SNIPPET]Team System Full ANd Final By Me
Post by: [VN]truon_chan1 on March 16, 2013, 04:07:49 am
not bad