SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   [HELP]Gang Zone Capture (https://forum.sa-mp.com/showthread.php?t=347049)

the_zohan 31/05/2012 08:24 AM

[HELP]Gang Zone Capture
 
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

the_zohan 31/05/2012 08:26 AM

Re: [HELP]Gang Zone Capture
 
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

badnum23 31/05/2012 08:32 AM

Re: [HELP]Gang Zone Capture
 
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");
}


the_zohan 31/05/2012 08:47 AM

Re: [HELP]Gang Zone Capture
 
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

the_zohan 01/06/2012 05:33 AM

Re: [HELP]Gang Zone Capture
 
/bump
fall on 3-4th page

FearLe$$ 01/06/2012 05:57 AM

Re: [HELP]Gang Zone Capture
 
BTW zohan after getting Banned From COD5 Community, trying to make a community?

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

the_zohan 01/06/2012 03:49 PM

Re: [HELP]Gang Zone Capture
 
my community? never and this is for a freind

the_zohan 03/06/2012 03:13 AM

Re: [HELP]Gang Zone Capture
 
bump fell on 6th page

FearLe$$ 03/06/2012 03:17 AM

Re: [HELP]Gang Zone Capture
 
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..

the_zohan 03/06/2012 03:23 AM

Re: [HELP]Gang Zone Capture
 
send me the link of gm via pm


All times are GMT. The time now is 06:20 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.