Whats Wrong?? Need Help. Please
#1

Guys.. I was begging you all. Please help me. Sa-mp is platform for helping. I am here. I shall be very thank full to you.

Look i made 2 capture systems. With different checkpoints, co-ordinates, pickup and mapicon. When i try to capture industry(capture) then satellite(capture2) become ours. Not industry. Industry don't show the colour but satellite did.

Problem No. 2 is. A single team can capture soo many times a single zone. That is that if zone belong to PAKISTAN than pakistan still can capture zone. I want if zone belong to Pakistan and Pakistan try to capture than Server will say " You can't capture zone that you owned". And we can' capture zone. Zone still remain same.


Here are My Codes:

pawn Code:
new capture;
new capture2;
new playericon;
new playericon2;
pawn Code:
capture = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);//Satellite
 playericon = CreatePickup(1314, 23, -316.7369, 1594.6285, 75.6609, -1);
 capture2 = GangZoneCreate(110.9276, 1336.2961, 288.1409, 1484.4271);//Industry
 playericon2 = CreatePickup(1314, 23, 199.9323,1422.9177,10.5859, -1);
pawn Code:
public OnPlayerSpawn(playerid)
{
SetPlayerMapIcon(playerid,0,-316.7369,1594.6285,75.6609,53,19,2);
SetPlayerMapIcon(playerid,0,199.9323,1422.9177,10.5859,53,19,2);
return 1;
}
pawn Code:
public OnPlayerEnterCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 1)
    {
    timer[playerid] = SetTimerEx("SetZone",30000,false,"i",playerid);
    SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
    }
   
    if(Checkpoint[playerid] == 2)
    {
    timer[playerid] = SetTimerEx("SetZone",30000,false,"i",playerid);
    SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
    }

    return 1;
}

forward SetZone(playerid);
public SetZone(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
    GivePlayerMoney(playerid,3000);
    SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
    DisablePlayerCheckpoint(playerid);
    Checkpoint[playerid] = 0;
    SetGangZone(playerid);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
    GangZoneShowForAll(capture,GREENA);
   
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
   
    if(gTeam[playerid] == TEAM_GERMANY)
    {
    GangZoneShowForAll(capture,ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Germany",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
   
    if(gTeam[playerid] == TEAM_USA)
    {
    GangZoneShowForAll(capture,BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
   
    if(gTeam[playerid] == TEAM_RUSSIA)
    {
    GangZoneShowForAll(capture,REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
   
    if(gTeam[playerid] == TEAM_INDIA)
    {
    GangZoneShowForAll(capture,YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
    return 1;
}

forward SetZone2(playerid);
public SetZone2(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
    GivePlayerMoney(playerid,3000);
    SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
    DisablePlayerCheckpoint(playerid);
    SetGangZone2(playerid);
    Checkpoint[playerid] = 0;
    return 1;
}

forward SetGangZone2(playerid);
public SetGangZone2(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
    GangZoneShowForAll(capture2,GREENA);

    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_GERMANY)
    {
    GangZoneShowForAll(capture2,ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Germany",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_USA)
    {
    GangZoneShowForAll(capture2,BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_RUSSIA)
    {
    GangZoneShowForAll(capture2,REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_INDIA)
    {
    GangZoneShowForAll(capture2,YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
    return 1;
}
pawn Code:
public OnPlayerLeaveCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 1)
    {
        KillTimer(timer[playerid]);
        SendClientMessage(playerid,RED,"Capturing Zone Failed You have Left the Marker. ");
        DisablePlayerCheckpoint(playerid);
        Checkpoint[playerid] = 0;
    }
   
    if(Checkpoint[playerid] == 2)
    {
        KillTimer(timer[playerid]);
        SendClientMessage(playerid,RED,"Capturing Zone Failed You have Left the Marker. ");
        DisablePlayerCheckpoint(playerid);
        Checkpoint[playerid] = 0;
    }
    return 1;
}
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == playericon)
    {
        if(Checkpoint[playerid] != 1)
        {
            Checkpoint[playerid] = 1;
            SetPlayerCheckpoint(playerid, -316.7369,1594.6285,75.6609,2);
            return 1;
        }
    }
   
    if(pickupid == playericon2)
    {
        if(Checkpoint[playerid] != 2)
        {
            Checkpoint[playerid] = 2;
            SetPlayerCheckpoint(playerid, 199.9323,1422.9177,10.5859,2);
            return 1;
        }
    }
    return 0;
}
> I am waiting for you help...
Reply
#2

pawn Code:
new cZone[20]=-1;
Now, when a team captures a zone.
pawn Code:
cZone[GangZone] = TEAM_PAKISTAN;
Now when a player of team enter checkpoint
pawn Code:
if(gTeam[playerid] == cZone[GangZone]) return SendClientMessage(playerid,0xFFFFFF,"This zone is of your team.");
Btw to make multiple CP, you need Streamer.
Reply
#3

Edit: Compiling Fine with Streamer. Now will the above code works?? Now

And i have 4 teams. So how i write?
cZone[GangZone] = TEAM_PAKISTAN and other teams??;
Reply
#4

Now i copied your code. Now i have streamer. And it is compiling fine. But in Game when i capture satellite it capture both gas station and satellite. Go check it.. Now whats the problem??

pawn Code:
#include <a_samp>
#include <streamer>
#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4

#define YELLOWA 0xFFFF00AA
#define GREENA 0x008000AA
#define BLUEA 0x0080FFAA
#define REDA 0xFF0000AA
#define ORANGEA 0xFF8000AA

#define RED 0xFF0000FF


#define GREEN 0x008000FF
#pragma tabsize 0
#define GZONE 0
#define GAS 1
new gTeam[MAX_PLAYERS];
new timer[MAX_PLAYERS][30];


main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

new Checkpoint[30];
new Zone[30];

public OnGameModeInit()
{
    AddPlayerClass(0, -316.7369-5,1594.6285,75.6609, 269.1425, 0, 0, 0, 0, 0, 0);
    Checkpoint[GZONE] =  CreateDynamicCP(-316.7369+10,1594.6285,75.6609,2,-1,-1,-1);
    Checkpoint[GAS] =  CreateDynamicCP( 611.5208, 1689.866, 15,2,-1,-1,-1);
    Zone[GZONE] = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);
    Zone[GAS] = GangZoneCreate(521.7093, 1616.373, 677.9031, 1798.172);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    TogglePlayerDynamicCP(playerid, Checkpoint[GZONE],1);
    TogglePlayerDynamicCP(playerid, Checkpoint[GAS],1);
    return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        timer[playerid][GZONE] = SetTimerEx("SetZone",30000,false,"i",playerid);
        SendClientMessage(playerid,0xFFFFFF,"You enter gangZone CP");
    }
    if(checkpointid == Checkpoint[GAS])
    {
        timer[playerid][GAS] = SetTimerEx("SetZone",30000,false,"i",playerid);
        SendClientMessage(playerid,0xFFFFFF,"You enter GAS CP");
    }
    return 1;
}

public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        KillTimer(timer[playerid][GZONE]);
        SendClientMessage(playerid,0xFFFFFF,"You left gangZone CP");
    }
    if(checkpointid == Checkpoint[GAS])
    {
        KillTimer(timer[playerid][GAS]);
        SendClientMessage(playerid,0xFFFFFF,"You left GAS CP");
    }
    return 1;
}
forward SetZone(playerid);
public SetZone(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
    GivePlayerMoney(playerid,3000);
    SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
    SetGangZone(playerid);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
    GangZoneShowForAll(Zone[GAS],GREENA);

    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_GERMANY)
    {
    GangZoneShowForAll(Zone[GAS],ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_USA)
    {
    GangZoneShowForAll(Zone[GAS],BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_RUSSIA)
    {
    GangZoneShowForAll(Zone[GAS],REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_INDIA)
    {
    GangZoneShowForAll(Zone[GAS],YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
    GangZoneShowForAll(Zone[GZONE],GREENA);

    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_GERMANY)
    {
    GangZoneShowForAll(Zone[GZONE],ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_USA)
    {
    GangZoneShowForAll(Zone[GZONE],BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_RUSSIA)
    {
    GangZoneShowForAll(Zone[GZONE],REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }

    if(gTeam[playerid] == TEAM_INDIA)
    {
    GangZoneShowForAll(Zone[GZONE],YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
    return 1;
}
Reply
#5

pawn Code:
#include <a_samp>
#include <streamer>
#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4

#define YELLOWA 0xFFFF00AA
#define GREENA 0x008000AA
#define BLUEA 0x0080FFAA
#define REDA 0xFF0000AA
#define ORANGEA 0xFF8000AA

#define RED 0xFF0000FF


#define GREEN 0x008000FF
#pragma tabsize 0
#define GZONE 0
#define GAS 1

new gTeam[MAX_PLAYERS];
new timer[MAX_PLAYERS][30];
new iCP[MAX_PLAYERS];//To check player went in which CP.
new tCP[30];

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

new Checkpoint[30];
new Zone[30];

public OnGameModeInit()
{
    AddPlayerClass(0, -316.7369-5,1594.6285,75.6609, 269.1425, 0, 0, 0, 0, 0, 0);
    Checkpoint[GZONE] =  CreateDynamicCP(-316.7369+10,1594.6285,75.6609,2,-1,-1,-1);
    Checkpoint[GAS] =  CreateDynamicCP( 611.5208, 1689.866, 15,2,-1,-1,-1);
    Zone[GZONE] = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);
    Zone[GAS] = GangZoneCreate(521.7093, 1616.373, 677.9031, 1798.172);
    tCP[GZONE] = -1;
    tCP[GAS]= -1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    TogglePlayerDynamicCP(playerid, Checkpoint[GZONE],1);
    TogglePlayerDynamicCP(playerid, Checkpoint[GAS],1);
    return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        if(tCP[GZONE] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team.");
        timer[playerid][GZONE] = SetTimerEx("SetZone",2000,false,"i",playerid);
        SendClientMessage(playerid,0xFFFFFF,"You enter gangZone CP");
        iCP[playerid] = GZONE;
    }
    if(checkpointid == Checkpoint[GAS])
    {
        if(tCP[GAS] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team.");
        timer[playerid][GAS] = SetTimerEx("SetZone",2000,false,"i",playerid);
        SendClientMessage(playerid,0xFFFFFF,"You enter GAS CP");
        iCP[playerid] = GAS;
    }
    return 1;
}

public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        KillTimer(timer[playerid][GZONE]);
        SendClientMessage(playerid,0xFFFFFF,"You left gangZone CP");
        iCP[playerid] = -1;//None
    }
    if(checkpointid == Checkpoint[GAS])
    {
        KillTimer(timer[playerid][GAS]);
        SendClientMessage(playerid,0xFFFFFF,"You left GAS CP");
        iCP[playerid] = -1;
    }
    return 1;
}
forward SetZone(playerid);
public SetZone(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
    GivePlayerMoney(playerid,3000);
    SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
    SetGangZone(playerid);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],GREENA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_PAKISTAN;
    }

    if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_GERMANY;
    }

    if(gTeam[playerid] == TEAM_USA && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_USA;
    }

    if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_RUSSIA;
    }

    if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_INDIA;
    }

    if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],GREENA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_PAKISTAN;
    }

    if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_GERMANY;
    }

    if(gTeam[playerid] == TEAM_USA&& iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_USA;
    }

    if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_RUSSIA;
    }

    if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_INDIA;
    }
    return 1;
}
Reply
#6

@Roxxor. I copied your code. But Gas Station is not working.. Satellite is fine. Please check gas station
Reply
#7

Both are working fine for me. Can you explain your problem a bit more?
Reply
#8

I am saying that gas station is not capturing. When i enter into gas station checkpoint nothing happens... It is not saying that you enter in Gas Station. Its not capturing. Satellite is fine..
Reply
#9

hm.. I dont know what is causing this bus, but when the chekpoint is above the building, it does not work.
So I changed checkpoint position and placed it on ground. and it started working.

Maybe it's a SAMP bug. I cant fix this bug.
This script will work as both CP are on ground.
pawn Code:
#include <a_samp>
#include <streamer>
#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4

#define YELLOWA 0xFFFF00AA
#define GREENA 0x008000AA
#define BLUEA 0x0080FFAA
#define REDA 0xFF0000AA
#define ORANGEA 0xFF8000AA

#define RED 0xFF0000FF


#define GREEN 0x008000FF
#pragma tabsize 0
#define GZONE 0
#define GAS 1

new gTeam[MAX_PLAYERS];
new timer[MAX_PLAYERS][30];
new iCP[MAX_PLAYERS];//To check player went in which CP.
new tCP[30];

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

new Checkpoint[30];
new Zone[30];

public OnGameModeInit()
{
    AddPlayerClass(0, 611.5208, 1689.866, 15, 269.1425, 0, 0, 0, 0, 0, 0);
    Checkpoint[GZONE] =  CreateDynamicCP(-316.7369+10,1594.6285,75.6609,2,-1,-1,-1);
    Checkpoint[GAS] =  CreateDynamicCP( 611.4569,1694.5847,6.9922,2,-1,-1,-1);
    Zone[GZONE] = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);
    Zone[GAS] = GangZoneCreate(521.7093, 1616.373, 677.9031, 1798.172);
    tCP[GZONE] = -1;
    tCP[GAS]= -1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    TogglePlayerDynamicCP(playerid, Checkpoint[GZONE],1);
    TogglePlayerDynamicCP(playerid, Checkpoint[GAS],1);
    return 1;
}

public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        if(tCP[GZONE] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team.");
        timer[playerid][GZONE] = SetTimerEx("SetZone",2000,false,"i",playerid);
        SendClientMessage(playerid,0xFFFFFF,"You enter gangZone CP");
        iCP[playerid] = GZONE;
    }
    if(checkpointid == Checkpoint[GAS])
    {
        if(tCP[GAS] == gTeam[playerid]) return SendClientMessage(playerid,0xFFFFFF,"This is already captured by your team.");
        timer[playerid][GAS] = SetTimerEx("SetZone",2000,false,"i",playerid);
        SendClientMessage(playerid,0xFFFFFF,"You enter GAS CP");
        iCP[playerid] = GAS;
    }
    return 1;
}

public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        KillTimer(timer[playerid][GZONE]);
        SendClientMessage(playerid,0xFFFFFF,"You left gangZone CP");
        iCP[playerid] = -1;//None
    }
    if(checkpointid == Checkpoint[GAS])
    {
        KillTimer(timer[playerid][GAS]);
        SendClientMessage(playerid,0xFFFFFF,"You left GAS CP");
        iCP[playerid] = -1;
    }
    return 1;
}
forward SetZone(playerid);
public SetZone(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
    GivePlayerMoney(playerid,3000);
    SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
    SetGangZone(playerid);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],GREENA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_PAKISTAN;
    }

    if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_GERMANY;
    }

    if(gTeam[playerid] == TEAM_USA && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_USA;
    }

    if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_RUSSIA;
    }

    if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == GAS)
    {
    GangZoneShowForAll(Zone[GAS],YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured GasStation For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GAS] = TEAM_INDIA;
    }

    if(gTeam[playerid] == TEAM_PAKISTAN && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],GREENA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_PAKISTAN;
    }

    if(gTeam[playerid] == TEAM_GERMANY && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],ORANGEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For Pakistan",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_GERMANY;
    }

    if(gTeam[playerid] == TEAM_USA&& iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],BLUEA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For USA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_USA;
    }

    if(gTeam[playerid] == TEAM_RUSSIA && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],REDA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For RUSSIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_RUSSIA;
    }

    if(gTeam[playerid] == TEAM_INDIA && iCP[playerid] == GZONE)
    {
    GangZoneShowForAll(Zone[GZONE],YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Satellite For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    tCP[GZONE] = TEAM_INDIA;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)