Please can anyone help me ?
#1

i need a thing that prevents me to capture an area that already being captured by another one !!


In Another way i need that no 2 teams can capture the same area at the same time if the area being captured by a player you need to kill him or move him from the checkpoint to be able to capture the area else you are prevented cuz another one is already capturing this area



no 2 teams can capture the same area at the same time
Reply
#2

Find the function which checks if a player is inside an area (so he can capture it), then check if any other player(s) (in a different team) is/are inside the same area.
Just run a loop and check for each player's X,Y,Z information.
Reply
#3

can you explain it more or just give me an example
Reply
#4

No,you don't understand what his asking xD
Healian,what do you use to check if the are is captured?
What variable?
Reply
#5

if(Area1 == 1)
{
if(gTeam[playerid] == TEAM_Arabian)
SendClientMessage(playerid,0xADFF2FAA, "This area is already captured by your team");
KillTimer(timer1);

}
else
{
if(gTeam[playerid] == TEAM_Arabian) timer1;
SendClientMessage(playerid,0xADFF2FAA, "Stay here for 30 seconds to capture the area");
KillTimer(timoo2);
KillTimer(timoo3);
KillTimer(timoo4);
KillTimer(timoo5);
Reply
#6

Give me your Timer1
pawn Код:
public Timer1(...)
Reply
#7

new timer1;

forward MyTimer(playerid);
public MyTimer(playerid)//Belltimer
{
if(gTeam[playerid] == TEAM_Arabian)
GangZoneShowForAll(a1,0xB8860BAA);
SendClientMessageToAll(0xFF9900AA, "The Bell has been controlled by the Arabians");
Area1 = 1;
KillTimer(timer1);
}
Reply
#8

i need if i am standing in the check point capturing the area no one can come capture it with me only clear check point without any one inside it can be captured
Reply
#9

Quote:
Originally Posted by Healian
Посмотреть сообщение
new timer1;

forward MyTimer(playerid);
public MyTimer(playerid)//Belltimer
{
if(gTeam[playerid] == TEAM_Arabian)
GangZoneShowForAll(a1,0xB8860BAA);
SendClientMessageToAll(0xFF9900AA, "The Bell has been controlled by the Arabians");
Area1 = 1;
KillTimer(timer1);
}
Pffu,your not even saving the area capturators
You need to create a saving file.Try to edit a GM if your beginner or request one:

https://sampforum.blast.hk/showthread.php?tid=129133 COD5 GM
https://sampforum.blast.hk/showthread.php?tid=29763 TURF WARS
or search the ******

this is the script request thread:
https://sampforum.blast.hk/showthread.php?tid=187229

EDIT:Im trying to script the COD5 for you,but im kinda busy.
Reply
#10

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
No,you don't understand what his asking xD
Healian,what do you use to check if the are is captured?
What variable?
After reading all of your posts I'm sure I understood him correctly

You will have to save the area stats, but even if you do not do that, you will have to check it like that:

pawn Код:
if(Area1 == 1)
{
    if(gTeam[playerid] == TEAM_Arabian)
    {
        SendClientMessage(playerid,0xADFF2FAA, "This area is already captured by your team");
        KillTimer(timer1);
    }
    else
    {
        new Float:x, Float:y, Float:z;
        for(new i = 0; i< MAX_PLAYERS; i++)
        {
            GetPlayerPos(i, x, y, z);
            if (IsPlayerInRangeOfPoint(i, 15.0,AREA_X,AREA_Y,AREA_Z)) return 1; // won't do anything since there is already somebody in a different team in this area
            //AREA_X/AREA_Y/AREA_Z - You area position. Change it!
        }
        if(gTeam[playerid] == TEAM_Arabian) timer1;
        SendClientMessage(playerid,0xADFF2FAA, "Stay here for 30 seconds to capture the area");
        KillTimer(timoo2);
        KillTimer(timoo3);
        KillTimer(timoo4);
        KillTimer(timoo5);
    }
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)