[HELP]: How to make capture zones!
#1

Hello!

I searched for Tutorial on "How to make capture zones", but I didn't find anything useful...Can someone explain me a little?

Thanks!
Reply
#2

Search more.

https://sampforum.blast.hk/showthread.php?tid=250205
https://sampforum.blast.hk/showthread.php?tid=337874
https://sampforum.blast.hk/showthread.php?tid=353267
Reply
#3

I know how to make Gang Zones, but I want to know, how to make a capture zones like: When you enter the red checkpoint, then you have to wait some seconds to capture it... Anyway Thanks
Reply
#4

Here i scripted an example for you. Don't forgot to give +REP

pawn Код:
new CaptureFlag[MAX_PLAYERS];
new CaptureCounter[MAX_PLAYERS];

forward UpdatePlayerProgress(playerid);
public UpdatePlayerProgress(playerid)
{
    CaptureCounter[playerid]--;
    new string[58];
    format(string, sizeof(string), "~W~Wait ~Y~%d ~W~Seconds", CaptureCounter[playerid]);
    GameTextForPlayer(playerid, string, 1000, 3);
   
    if(CaptureCounter[playerid] == 0)
    {
        // Player has got the flag, what should happen now?
    }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) // The Player is in capture checkpoint
    {
        // Don't forgot to check player's team.
        CaptureCounter[playerid] = 20;
        CaptureFlag[playerid] = SetTimerEx("UpdatePlayerProgress", 1000, 1, "i", playerid);
        GameTextForPlayer(playerid, "~W~Wait ~Y~20 ~W~Seconds", 1000, 3);
    }
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    if(CaptureCounter[playerid] < 20 && IsPlayerInRangeOfPoint(playerid, 10.0, X, Y, Z))
    {
        KillTimer(CaptureFlag[playerid]);
        GameTextForPlayer(playerid, "Failed! Please Stay~n~In The Checkpoint", 3000, 3);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(CaptureFlag[playerid]);
    CaptureCounter[playerid] = 20;
    return 1;
}
Reply
#5

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)