SA-MP Forums Archive
[HELP]Gang Zone Capture - 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)
+--- Thread: [HELP]Gang Zone Capture (/showthread.php?tid=347049)



[HELP]Gang Zone Capture - the_zohan - 31.05.2012

ok For Example here is the gangzone
pawn Code:
new gangzone;
 
public OnGameModeInit()
{
    gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
    return 1;
}
 
public OnPlayerSpawn(playerid)
{
    if(IsPlayerAdmin(playerid)) GangZoneShowForAll(gangzone,COLOR_RED);
    return 1;
}
And here is the checkpoint
pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
    GivePlayerMoney(playerid, 5000);
    DisablePlayerCheckpoint(playerid);
    return 1;
}
now i want if some one comes in checkpoint and stays 30 secs and caps and and get 5 score + 5000 money and gangzone color =his team


Re: [HELP]Gang Zone Capture - the_zohan - 31.05.2012

these are teams + colors

pawn Code:
#define TEAM_USA 1
#define TEAM_COLOR_USA COLOR_BLUE
#define TEAM_JAPAN 2
#define TEAM_COLOR_JAPAN COLOR_WHITE
#define TEAM_GERMANY 3
#define TEAM_COLOR_GERMANY COLOR_BROWN
#define TEAM_RUSSIA 4
#define TEAM_COLOR_RUSSIA COLOR_RED
#define TEAM_ENGLAND 5
#define TEAM_COLOR_ENGLAND COLOR_PLUM
#define TEAM_MEXICO 6
#define TEAM_COLOR_MEXICO COLOR_LIMEGREEN
#define TEAM_INDIA 7
#define TEAM_COLOR_INDIA COLOR_CORAL
#define TEAM_BRAZIL 8
#define TEAM_COLOR_BRAZIL COLOR_AQUA
#define TEAM_FRANCE 9
#define TEAM_COLOR_FRANCE COLOR_INDIGO
#define TEAM_INDONESIA 10
#define TEAM_COLOR_INDONESIA COLOR_BISQUE



Re: [HELP]Gang Zone Capture - badnum23 - 31.05.2012

Create a function that will give money, score and new property to player.
For example:
Code:
forward gangZoneComplete(playerid);
public gangZoneComplete(playerid)
{
	GivePlayerMoney(playerid, 5000);
	//Up score
	//setup zone
       DisablePlayerCheckpoint(playerid);
}
Next
Code:
public OnPlayerEnterCheckpoint(playerid)
{
    new timerId = setTimerEx("gangZoneComplete", 1000 * 30, false, "i", playerid);
    SetPVarInt(playerid, "gangZoneTimer", timerId);
    SetPVarInt(playerid, "onGangZone", 1);
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    if (GetPVarInt(playerid, "onGangZone")
        KillTimer(GetPVarInt(playerid, "gangZoneTimer"));
    DelPVar(playerid, "onGangZone");
    DelPVar(playerid, "gangZoneTimer");
}



Re: [HELP]Gang Zone Capture - the_zohan - 31.05.2012

u mean this?
pawn Code:
#define TEAM_USA 1
#define TEAM_COLOR_USA COLOR_BLUE
#define TEAM_JAPAN 2
#define TEAM_COLOR_JAPAN COLOR_WHITE
#define TEAM_GERMANY 3
#define TEAM_COLOR_GERMANY COLOR_BROWN
#define TEAM_RUSSIA 4
#define TEAM_COLOR_RUSSIA COLOR_RED
#define TEAM_ENGLAND 5
#define TEAM_COLOR_ENGLAND COLOR_PLUM
#define TEAM_MEXICO 6
#define TEAM_COLOR_MEXICO COLOR_LIMEGREEN
#define TEAM_INDIA 7
#define TEAM_COLOR_INDIA COLOR_CORAL
#define TEAM_BRAZIL 8
#define TEAM_COLOR_BRAZIL COLOR_AQUA
#define TEAM_FRANCE 9
#define TEAM_COLOR_FRANCE COLOR_INDIGO
#define TEAM_INDONESIA 10
#define TEAM_COLOR_INDONESIA COLOR_BISQUE

new gangzone;
 
public OnGameModeInit()
{
    gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
    return 1;
}
 
public OnPlayerSpawn(playerid)
{
    if(IsPlayerAdmin(playerid)) GangZoneShowForAll(gangzone,COLOR_RED);
forward gangZoneComplete(playerid);
public gangZoneComplete(playerid)
{
    GivePlayerMoney(playerid, 5000);
    //Up score
    //setup zone
}
    return 1;
}
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
{
    new timerId = setTimerEx("gangZoneComplete", 1000 * 30, false, "i", playerid);
    SetPVarInt(playerid, "gangZoneTimer", timerId);
    SetPVarInt(playerid, "onGangZone", 1);
 
}


public OnPlayerLeaveCheckpoint(playerid)
{
    if (GetPVarInt(playerid, "onGangZone")
        KillTimer(GetPVarInt(playerid, "gangZoneTimer"));
    DelPVar(playerid, "onGangZone");
    DelPVar(playerid, "gangZoneTimer");
}
    GivePlayerMoney(playerid, 5000);
    GivePlayerScore(playerid,5);
    DisablePlayerCheckpoint(playerid);
    return 1;
}
now how can gang zone change when a team member captures and gangzone color changes to its team color


Re: [HELP]Gang Zone Capture - the_zohan - 01.06.2012

/bump
fall on 3-4th page


Re: [HELP]Gang Zone Capture - FearLe$$ - 01.06.2012

BTW zohan after getting Banned From COD5 Community, trying to make a community?

NVM.. if u have a server im a free scripter..


Re: [HELP]Gang Zone Capture - the_zohan - 01.06.2012

my community? never and this is for a freind


Re: [HELP]Gang Zone Capture - the_zohan - 03.06.2012

bump fell on 6th page


Re: [HELP]Gang Zone Capture - FearLe$$ - 03.06.2012

u should take a start from a GM ill suggest to use CODMW its has toooo many capture zones and u get 5000$ and 5 Score + its has Classes and Stuff like Nuke..


Re: [HELP]Gang Zone Capture - the_zohan - 03.06.2012

send me the link of gm via pm