Capturing Zone problem!! need Help
#1

I did This. but it is not showing zone in map neither capturing:

pawn Код:
#include <a_samp>

#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4

#define YELLOW 0xFFFF00FF
#define GREEN 0x008000FF
#define BLUE 0x0080FFFF
#define RED 0xFF0000FF
#define ORANGE 0xFF8000FF

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Capture Zones By Zohan                 ");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
new Checkpoint[MAX_PLAYERS];
new gangzone;
gangzone = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);

public OnPlayerSpawn()
{
Checkpoint = SetPlayerCheckpoint(playerid, 970.7667, 1976.103, 15, 5);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(Checkpoint[playerid] = 1)
{
SendClientMessage(playerid,color,"wait 30 seconds");
SetTimerEx("SetZone",30000,false,"i",playerid);
}
return 1;
}
forward SetZone(playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 3)
GivePlayerMoney(playerid,3000);
public SetGangZone(playerid)
{
if(gTeam[playerid] == TEAM_PAKISTAN)
    {
        GangZoneShowForAll(gangzone,GREEN);
    }
    if(gTeam[playerid] == TEAM_GERMANY)
    {
        GangZoneShowForAll(gangzone,ORANGE);
    }
    if(gTeam[playerid] == TEAM_USA)
    {
        GangZoneShowForAll(gangzone,BLUE);
    }
    if(gTeam[playerid] == TEAM_RUSSIA)
    {
        GangZoneShowForAll(gangzone,RED);
    }
    if(gTeam[playerid] == TEAM_INDIA)
    {
        GangZoneShowForAll(gangzone,YELLOW);
    }
return 1;
}
#endif
#include <a_samp>

#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4

#define YELLOW 0xFFFF00FF
#define GREEN 0x008000FF
#define BLUE 0x0080FFFF
#define RED 0xFF0000FF
#define ORANGE 0xFF8000FF

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Capture Zones By Zohan                 ");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
new Checkpoint[MAX_PLAYERS];
new gangzone;
gangzone = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);

public OnPlayerSpawn()
{
Checkpoint = SetPlayerCheckpoint(playerid, 970.7667, 1976.103, 15, 5);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(Checkpoint[playerid] = 1)
{
SendClientMessage(playerid,color,"wait 30 seconds");
SetTimerEx("SetZone",30000,false,"i",playerid);
}
return 1;
}
forward SetZone(playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 3)
GivePlayerMoney(playerid,3000);
public SetGangZone(playerid)
{
if(gTeam[playerid] == TEAM_PAKISTAN)
    {
        GangZoneShowForAll(gangzone,GREEN);
    }
    if(gTeam[playerid] == TEAM_GERMANY)
    {
        GangZoneShowForAll(gangzone,ORANGE);
    }
    if(gTeam[playerid] == TEAM_USA)
    {
        GangZoneShowForAll(gangzone,BLUE);
    }
    if(gTeam[playerid] == TEAM_RUSSIA)
    {
        GangZoneShowForAll(gangzone,RED);
    }
    if(gTeam[playerid] == TEAM_INDIA)
    {
        GangZoneShowForAll(gangzone,YELLOW);
    }
return 1;
}
#endif
Reply
#2

It was like errors had code and not code had error's but here I fixed it.
pawn Код:
#include <a_samp>

#define TEAM_PAKISTAN 0
#define TEAM_GERMANY 1
#define TEAM_USA 2
#define TEAM_RUSSIA 3
#define TEAM_INDIA 4

#define YELLOW 0xFFFF00FF
#define GREEN 0x008000FF
#define BLUE 0x0080FFFF
#define RED 0xFF0000FF
#define ORANGE 0xFF8000FF
new gTeam[MAX_PLAYERS];
#pragma tabsize 0
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Capture Zones By Zohan                 ");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
#endif

new Checkpoint[MAX_PLAYERS];
new gangzone;

public OnGameModeInit()
{
    gangzone = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    Checkpoint[playerid] = 1;
    SetPlayerCheckpoint(playerid, 970.7667, 1976.103, 15, 5);
    return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 1)
    {
    SendClientMessage(playerid,RED,"wait 30 seconds");
    SetTimerEx("SetZone",30000,false,"i",playerid);
    }
    return 1;
}
forward SetZone(playerid);
public SetZone(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
    GivePlayerMoney(playerid,3000);
    SetGangZone(playerid);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
        GangZoneShowForAll(gangzone,GREEN);
    }
    if(gTeam[playerid] == TEAM_GERMANY)
    {
        GangZoneShowForAll(gangzone,ORANGE);
    }
    if(gTeam[playerid] == TEAM_USA)
    {
        GangZoneShowForAll(gangzone,BLUE);
    }
    if(gTeam[playerid] == TEAM_RUSSIA)
    {
        GangZoneShowForAll(gangzone,RED);
    }
    if(gTeam[playerid] == TEAM_INDIA)
    {
        GangZoneShowForAll(gangzone,YELLOW);
    }
    return 1;
}
Reply
#3

What is Class For?? I didn't understand..... And check point is on other way and zone is on other... Check pint was in lv and zone was near a51..
Reply
#4

I Added Player Class that just to test and forgot to remove it.
Gangzones and Checkpoint are coordinates given by you, I just made what you wanted.

PS : I edited my post and removed AddPlayerClass
Reply
#5

So gangzone and check point co-ordinates will same?? Like This?

pawn Код:
gangzone = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);
SetPlayerCheckpoint(playerid, -392.1586, 1499.8591, -263.7490, 1630.3291);
Its an Example..
Reply
#6

Use this to create GangZones

https://sampforum.blast.hk/showthread.php?tid=372
Reply
#7

Thnaks all Done perfectly. one More thing. My Check point is very big. I want it small. It is very big.
Here are its co-ordinates "SetPlayerCheckpoint(playerid, -316.7369,1594.6285,75.6609,13.9541);"

And it show red icon in map. I don't want red icon... I want flag icon in map. How can i do that??

And in this when player left check point it still capturing zone.?? I want when player left check point than timer will off and it say that Faild: You left marker
Reply
#8

You can Set the Checkpoint Size easy. I use this on my server for the /search like a gps system:

Quote:

forward SetPlayerCheckpointArea(playerid, [areasize])

Areas size is the location of 4 points. You need to get diamond shaped cords and put them together then it will forma circle of the size you want.

Or for a simple way, you can create it on MTA mapping and implement it into you server pickup
Reply
#9

I did This:

pawn Код:
new Checkpoint[MAX_PLAYERS];

    Checkpoint[playerid] = 1;
    SetPlayerCheckpoint(playerid, -316.7369,1594.6285,75.6609,13.9541);
   
    Checkpoint[playerid] = 2;
    SetPlayerCheckpoint(playerid, 199.9323,1422.9177,10.5859,88.7674);

public OnPlayerEnterCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 1)
    {
    SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
    SetTimerEx("SetZone",30000,false,"i",playerid);
    }
    else if(Checkpoint[playerid] == 2)
    {
    SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
    SetTimerEx("SetZone",30000,false,"i",playerid);
    }
   
    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);
    SetGangZone2(playerid);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
    GangZoneShowForAll(gangzone5,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(gangzone5,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(gangzone5,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(gangzone5,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(gangzone5,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 SetGangZone2(playerid);
public SetGangZone2(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
    GangZoneShowForAll(gangzone6,GREENA);

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

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

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

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

    if(gTeam[playerid] == TEAM_INDIA)
    {
    GangZoneShowForAll(gangzone6,YELLOWA);
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Server News: %s has captured Industry For INDIA",pName);
    SendClientMessageToAll(0x008000AA,string);
    }
    return 1;
}
But it is only showing one marker. one checkpoint Not other. Why this so??
Reply
#10

Use SetPlayerMapIcon to place a map icon, pick one from here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)