SA-MP Forums Archive
Please can anyone help me ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please can anyone help me ? (/showthread.php?tid=225844)



Please can anyone help me ? - Healian - 14.02.2011

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


Re: Please can anyone help me ? - _Tommy - 14.02.2011

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.


Re: Please can anyone help me ? - Healian - 14.02.2011

can you explain it more or just give me an example


Re: Please can anyone help me ? - SkizzoTrick - 14.02.2011

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


Re: Please can anyone help me ? - Healian - 14.02.2011

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);


Re: Please can anyone help me ? - SkizzoTrick - 14.02.2011

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



Re: Please can anyone help me ? - Healian - 14.02.2011

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);
}


Re: Please can anyone help me ? - Healian - 14.02.2011

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


Re: Please can anyone help me ? - SkizzoTrick - 14.02.2011

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.


Re: Please can anyone help me ? - _Tommy - 14.02.2011

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);
    }
}