Showing Only One Check Point!
#1

Guys I Did This:

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 YELLOWA 0xFFFF00AA
#define GREENA 0x008000AA
#define BLUEA 0x0080FFAA
#define REDA 0xFF0000AA
#define ORANGEA 0xFF8000AA

#define RED 0xFF0000FF
#define GREEN 0x008000FF

new gTeam[MAX_PLAYERS];
new timer[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 gangzone5;
new GasStation2;

public OnGameModeInit()
{
    gangzone5 = GangZoneCreate(-392.1586, 1499.8591, -263.7490, 1630.3291);
    GasStation2 = GangZoneCreate(521.7093, 1616.373, 677.9031, 1798.172);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    Checkpoint[playerid] = 2;
    SetPlayerCheckpoint(playerid, 611.5208, 1689.866, 15, 5);
   
    Checkpoint[playerid] = 1;
    SetPlayerCheckpoint(playerid, -316.7369,1594.6285,75.6609,13.9541);
    SetPlayerMapIcon(playerid,0,-316.7369,1594.6285,75.6609,53,19,2);
    return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(Checkpoint[playerid] == 2)
    {
    SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
    timer[playerid] = SetTimerEx("SetZone",30000,false,"i",playerid);
    }
    if(Checkpoint[playerid] == 1)
    {
    SendClientMessage(playerid,RED,"Wait For 30 Sec. Don't leave Marker or Capturing will be Failed");
    timer[playerid] = 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);
    return 1;
}
forward SetGangZone(playerid);
public SetGangZone(playerid)
{
    if(gTeam[playerid] == TEAM_PAKISTAN)
    {
    GangZoneShowForAll(GasStation2,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(GasStation2,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(GasStation2,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(GasStation2,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(GasStation2,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(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;
}
But it is only showing one checkpoint of gangzone5. it is now showing GasStation2 CheckPoint. please FiX it. i shall be very thanks full to you
Reply
#2

Wait, I am making script for you.
You will need streamer to make multiple CP
Reply
#3

Ok Bro . Waiting For You...
Reply
#4

You can only show one checkpoint at a given time.

https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#5

What about on playerpickup for capturing zones instead of check points?? When you enter in pickup it will show checkpoint (redmarker) and gangzone start capturing??
Reply
#6

You could use this:
https://sampforum.blast.hk/showthread.php?tid=250174
Reply
#7

ok here we go.

With streamer plugin, you can only show 1 CP at a time, but it will work

Download Streamer plugin and place plugin in your plugin folder and inc file in pawn/include.
Add this to your server.cgf

Код:
plugins streamer
Now here the code.

The defines goes at the top.
pawn Код:
#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

new gTeam[MAX_PLAYERS];
Now, we want to create multiple CP and multiple GangZone, so we create an array for it.
pawn Код:
new Checkpoint[30];
new Zone[30];
We need to define a variable to remember the array index number.So we define
pawn Код:
#define GZONE 0 //GangZone5
#define GAS 1//GAS STATION
Now, the timer which is needed to check that player must be in CP to capture the zone
pawn Код:
new timer[MAX_PLAYERS][30];//30 is max no of Zones, Increase if you want.
Now lets create zones and checkpoints.
pawn Код:
public OnGameModeInit()
{
//See how i used GZONE and GAS to remember which CP is for which
    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;
}
To make CP visible to player when he spawns.
pawn Код:
public OnPlayerSpawn(playerid)
{
    TogglePlayerDynamicCP(playerid, Checkpoint[GZONE],1);
    TogglePlayerDynamicCP(playerid, Checkpoint[GAS],1);
    return 1;
}
To start timer when player enters checkpoint.
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        timer[playerid][GZONE] = SetTimerEx("SetZone",30000,false,"i",playerid);
       
    }
    if(checkpointid == Checkpoint[GAS])
    {
        timer[playerid][GAS] = SetTimerEx("SetZone",30000,false,"i",playerid);
       
    }
    return 1;
}
And to Kill Timer when player leaves CP
pawn Код:
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == Checkpoint[GZONE])
    {
        KillTimer(timer[playerid][GZONE]);
       
    }
    if(checkpointid == Checkpoint[GAS])
    {
        KillTimer(timer[playerid][GAS]);
       
    }
    return 1;
}
And the rest is same.
pawn Код:
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;
}
FULL CODE :
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#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
#8

Giving These Errors:
pawn Код:
E:\UDC Server\pawno\include\streamer.inc(156) : error 017: undefined symbol "OBJECT_MATERIAL_SIZE_256x128"
E:\UDC Server\pawno\include\streamer.inc(382) : warning 235: public function lacks forward declaration (symbol "OnPlayerEditObject")
E:\UDC Server\pawno\include\streamer.inc(404) : warning 235: public function lacks forward declaration (symbol "OnPlayerSelectObject")
E:\UDC Server\pawno\include\streamer.inc(406) : error 017: undefined symbol "SELECT_OBJECT_PLAYER_OBJECT"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#9

you must have latest streamer https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#10

i already downloaded this....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)