DM zone with a "capture the..." idea
#1

2 bases (2 teams), if for example a person from the blue team makes it too the flag/pickup of the other red team, then there will be message shown "... has captured the flag, the blue team has won!" and then the players will be teleported back to their bases.
Is there any FS that has this kind of idea already?
If not, then what functions/things do I need to script in order to make this DM?

Thanks

ps: Its not a DM server, so I am looking for a FS, not a GM.
Reply
#2

pawn Код:
if(PlayerTeam == BLUE_TEAM) // Guessing the Blue team is defined as this
       {
       if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z)) // Enter your X,Y,Z there of the flag.
            {
                   SendClientMessage(playerid, COLOUR, "You have captured the flag, Your team wins);
                   SendClientMessageToAll(COLOUR, "
Blue team has won!");
                   SetPlayerPos(playerid, X, Y, Z);
             }
            else if(PlayerTeam == RED_TEAM) // Guessing the Blue team is defined as this
                    {
          if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z)) // Enter your X,Y,Z there of the flag.
               {
                   SendClientMessage(playerid, COLOUR, "
You have captured the flag, Your team wins);
                   SendClientMessageToAll(COLOUR, "Red team has won!");
                   SetPlayerPos(playerid, X, Y, Z);
                }
           }
      return 1;
}
Something similar to that should work.
Reply
#3

Quote:
Originally Posted by Dokins
Посмотреть сообщение
pawn Код:
if(PlayerTeam == BLUE_TEAM) // Guessing the Blue team is defined as this
       {
       if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z)) // Enter your X,Y,Z there of the flag.
            {
                   SendClientMessage(playerid, COLOUR, "You have captured the flag, Your team wins);
                   SendClientMessageToAll(COLOUR, "
Blue team has won!");
                   SetPlayerPos(playerid, X, Y, Z);
             }
            else if(PlayerTeam == RED_TEAM) // Guessing the Blue team is defined as this
                    {
          if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z)) // Enter your X,Y,Z there of the flag.
               {
                   SendClientMessage(playerid, COLOUR, "
You have captured the flag, Your team wins);
                   SendClientMessageToAll(COLOUR, "Red team has won!");
                   SetPlayerPos(playerid, X, Y, Z);
                }
           }
      return 1;
}
Something similar to that should work.
You forgot to close the two strings
Reply
#4

How do I define the teams? Sorry if it's a nubby question :/
Reply
#5

Anyone?
Reply
#6

#define YourTeam 1
Reply
#7

Doesn't work I put #define BLUE_TEAM 1 at the top of the script

Код:
if(PlayerTeam[playerid] == BLUE_TEAM) // Guessing the Blue team is defined as this
{
	if(IsPlayerInRangeOfPoint(playerid, 7.0, -840.6604, 1978.6160, 22.9245)) // Enter your X,Y,Z there of the flag.
 	{
  		SendClientMessage(playerid, COLOR_WHITE, "You have captured the flag, Your team wins");
    	SendClientMessageToAll(COLOR_WHITE, "Blue team has won!");
     	SetPlayerPos(playerid, -608.4156, 1830.7487, 7.0000);
     	return 1;
	}
}
but it gives me this errors:

(41) : error 010: invalid function or declaration
(43) : error 010: invalid function or declaration
(48 ) : error 010: invalid function or declaration

all the errors should be in the above lines (code)
Reply
#8

https://sampwiki.blast.hk/wiki/PAWN_tutorial
There is lots of info there on how to create teams.
Reply
#9

Example of two teams:
pawn Код:
#define TERRORISTS 0 //defines the terrorists as id 0 all sa-mp id's start at 0
#define MARINES 1 //defines the team Marines and the id of the team is
Reply
#10

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
You forgot to close the two strings
Oh yeah, I was doing the coding IN the post, I was expecting a few mistakes!

Thanks! :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)