[HELP]Gang Zone Capture
#1

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
Reply
#2

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
Reply
#3

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");
}
Reply
#4

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
Reply
#5

/bump
fall on 3-4th page
Reply
#6

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

NVM.. if u have a server im a free scripter..
Reply
#7

my community? never and this is for a freind
Reply
#8

bump fell on 6th page
Reply
#9

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..
Reply
#10

send me the link of gm via pm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)