Problem gang zones
#1

i used this program for creating

Код:
******************/post/10721/Advanced_Capture_Zone_Creator_%5BUnique_and_useful!%5D/Jarnu/other/tool
and i have 10 errors
help fast +rep

Код:
#include <streamer> //Important include you need to have streamer in-case you want this to work!
//Variables (Put them after your includes)
new iCP[MAX_PLAYERS];
new UnderAttack[30];
new Captured[30];
new CP[30];
new Zone[30];
new timer[MAX_PLAYERS][30];
new CountVar[MAX_PLAYERS] = 25;
new InCP[MAX_PLAYERS][30];
new CountTime[MAX_PLAYERS];
//=================================
new gTeam[MAX_PLAYERS]; //Team variable. ignore if you already got
#define TEAM_ARMY       0 //Ignore if you already got team defines
#define TEAM_TERRORIST  1 //Ignore if you already got team defines
#define TEAM_NONE       2 //Ignore if you already got team defines
#define ARMY_COLOR      0x375FFFFF
#define TERRORIST_COLOR 0xFF0000FF
//========Zone=Defines=============
#define Snakef 0
//=================================
//========OnGameModeInit Codes============
CP[Snakef] = CreateDynamicCP("-34.5398,2350.1331,24.3026,5,0,0,-1,25")
Zone[Snakef] = GangZoneCreate("-96,2280,48,2406")
UnderAttack[Snakef] = -1
Captured[Snakef] = -1
tCP[Snakef] = TEAM_NONE
//========== OnPlayerConnect codes ======
iCP[playerid] = -1;
InCP[playerid][GAS] = 0;
if(tCP[Snakef] == TEAM_ARMY) return GangZoneShowForPlayer(playerid, Zone[Snakef], 0x375FFFFF);
else if(tCP[Snakef] == TEAM_TERRORIST) return GangZoneShowForPlayer(playerid, Zone[Snakef], 0xFF0000FF);
//=========== OnPlayerDisconnect codes ==
if(InCP[playerid][Snakef] == 1)
{
    UnderAttack[Snakef] = 0;
}
//==========================================
//==========OnPlayerDeath Codes===================
KillTimer(timer[playerid][Snakef]);
KillTimer(CountTime[playerid]);
UnderAttack[Snakef] = 0;
//==========================================
//=======OnPlayerEnterDynamicCP (Main codes!)===========
//You can just copy paste the following in-case you didn't got the call back defined already!
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
     if(checkpointid == CP[Snakef])
     {
         if(UnderAttack[Snakef] == 1)
         {
             SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!");
         }
         else if(gTeam[playerid] == tCP[Snakef])
         {
             SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!");
         }
         else if(gTeam[playerid] == TEAM_NONE)
         {
             SendClientMessage(playerid, 0xFF0000FF,"You have no team so you cannot capture!");
         }
         else
         {
            UnderAttack[Snakef] = 1;
            timer[playerid][Snakef] = SetTimerEx("SetCaptureZone", 25000, false,"i",playerid);
            CountTime[playerid] = SetTimerEx("CountDown", 1, false,"i", playerid);
            iCP[playerid] = Snakef;
            InCP[playerid][Snakef] = 1;
            Captured[Snakef] = 0;
            if(gTeam[playerid] == TEAM_ARMY)
            {
                GangZoneFlashForAll(Zone[Snakef], ARMY_COLOR);
            }
            else if(gTeam[playerid] == TEAM_TERRORIST)
            {
                GangZoneFlashForAll(Zone[Snakef], TERRORIST_COLOR);
            }
            new string[128], name[MAX_PLAYER_NAME+1];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string),"%s is trying to capture theSnakef",name);
            SendClientMessageToAll(ARMY_COLOR, string);
         }
      }
      return 1;
}
//================================OnPlayerLeaveDynamicCP codes=============================
//You can just copy paste the following in-case you didn't got the call back defined already!
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == CP[Snakef])
    {
       if(Captured[Snakef] == 1)
       {
            GangZoneStopFlashForAll(Zone[Snakef]);
            UnderAttack[Snakef] = 0;
            InCP[playerid][Snakef] = 0;
            tCP[Snakef] = gTeam[playerid];
            if(gTeam[playerid] == TEAM_ARMY)
            {
                GangZoneShowForAll(Zone[Snakef], ARMY_COLOR);
            }
            else if(gTeam[playerid] == TEAM_TERRORIST)
            {
                GangZoneShowForAll(Zone[Snakef], TERRORIST_COLOR);
            }
            KillTimer(timer[playerid][Snakef]);
            KillTimer(CountTime[playerid]);
       }
       else if(Captured[Snakef] == 0)
       {
           SendClientMessage(playerid, TERRORIST_COLOR,"You have left the flag you have failed to capture the zone!");
           UnderAttack[Snakef] = 0;
           InCP[playerid][Snakef] = 0;
           GangZoneStopFlashForAll(Zone[Snakef]);
           KillTimer(timer[playerid][Snakef]);
           KillTimer(CountTime[playerid]);
       }
    }
    return 1;
}
//======================SetCaptureZone function!====================
//You can just copy paste the following under the above callback!
forward SetCaptureZone(playerid);
public SetCaptureZone(playerid)
{
     if(iCP[playerid] == Snakef)
     {
         SetPlayerScore(playerid, GetPlayerScore(playerid)+5);
         GivePlayerMoney(playerid, 5000);
         SendClientMessage(playerid, ARMY_COLOR,"Congratulations! You have successfully captured the Gas Station! You earned +5 scores and +$5000!");
         tCP[Snakef] = gTeam[playerid];
         if(gTeam[playerid] == TEAM_ARMY)
         {
             GangZoneShowForAll(Zone[Snakef], ARMY_COLOR);
         }
         else if(gTeam[playerid] == TEAM_TERRORIST)
         {
             GangZoneShowForAll(Zone[Snakef], TERRORIST_COLOR);
         }
         GangZoneStopFlashForAll(Zone[Snakef]);
         Captured[Snakef] = 1;
         KillTimer(CountTime[playerid]);
         KillTimer(timer[playerid][Snakef]);
     }
     return 1;
}
//====================CountTime Function======================
//You can just copy paste the following under the above function!
forward CountDown(playerid);
public CountDown(playerid)
{
    CountVar[playerid]--;
    if(CountVar[playerid] == 0)
    {
      CountVar[playerid] = 25;
      KillTimer(CountTime[playerid]);
    }
    else
    {
        new str[124];
        format(str, sizeof(str),"~n~~n~~n~~n~~n~~n~~r~%d/~y~25 ~w~Seconds left~n~~g~to capture", CountVar[playerid]);
        GameTextForPlayer(playerid, str, 1000, 3);
    }
    CountTime[playerid] = SetTimerEx("CountDown", 1000, false,"i", playerid);
    return 1;
}
//-------------Capture Zone Codes Created using J_Capture Zone tool!-----------//
Код:
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(23) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(29) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(31) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(32) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(34) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(40) : error 021: symbol already defined: "KillTimer"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(54) : error 017: undefined symbol "tCP"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(54) : warning 215: expression has no effect
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(54) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(54) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(54) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.
Reply
#2

I think you forgot to
pawn Код:
#include <a_samp>
Reply
#3

again 10 errors
Quote:

D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(30) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(36) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(3 : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(39) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(41) : error 010: invalid function or declaration
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(47) : error 021: symbol already defined: "KillTimer"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(61) : error 017: undefined symbol "tCP"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(61) : warning 215: expression has no effect
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(61) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(61) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\snakef.pwn(61) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


10 Errors.

Reply
#4

i fixed 3 errors but again

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <streamer>
#include <a_samp>
#include <sscanf2>
#include <SII>
//Important include you need to have streamer in-case you want this to work!
//Variables (Put them after your includes)
new iCP[MAX_PLAYERS];
new UnderAttack[30];
new Captured[30];
new CP[30];
new Zone[30];
new timer[MAX_PLAYERS][30];
new CountVar[MAX_PLAYERS] = 25;
new InCP[MAX_PLAYERS][30];
new CountTime[MAX_PLAYERS];
//=================================
new gTeam[MAX_PLAYERS]; //Team variable. ignore if you already got
#define TEAM_ARMY       0 //Ignore if you already got team defines
#define TEAM_TERRORIST  1 //Ignore if you already got team defines
#define TEAM_NONE       2 //Ignore if you already got team defines
#define ARMY_COLOR      0x375FFFFF
#define TERRORIST_COLOR 0xFF0000FF
//========Zone=Defines=============
#define Snakef 0

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

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

#endif

public OnGameModeInit()
{
CP[Snakef] = CreateDynamicCP("-34.5398,2350.1331,24.3026,5,0,0,-1,25")
Zone[Snakef] = GangZoneCreate("-96,2280,48,2406")
UnderAttack[Snakef] = -1
Captured[Snakef] = -1
tCP[Snakef] = TEAM_NONE

	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
iCP[playerid] = -1;
InCP[playerid][GAS] = 0;
if(tCP[Snakef] == TEAM_ARMY) return GangZoneShowForPlayer(playerid, Zone[Snakef], 0x375FFFFF);
else if(tCP[Snakef] == TEAM_TERRORIST) return GangZoneShowForPlayer(playerid, Zone[Snakef], 0xFF0000FF);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
if(InCP[playerid][Snakef] == 1)
{
    UnderAttack[Snakef] = 0;
}
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
KillTimer(timer[playerid][Snakef]);
KillTimer(CountTime[playerid]);
UnderAttack[Snakef] = 0;
	return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
     if(checkpointid == CP[Snakef])
     {
         if(UnderAttack[Snakef] == 1)
         {
             SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!");
         }
         else if(gTeam[playerid] == tCP[Snakef])
         {
             SendClientMessage(playerid, 0xFF0000FF,"This zone is already being captured!");
         }
         else if(gTeam[playerid] == TEAM_NONE)
         {
             SendClientMessage(playerid, 0xFF0000FF,"You have no team so you cannot capture!");
         }
         else
         {
            UnderAttack[Snakef] = 1;
            timer[playerid][Snakef] = SetTimerEx("SetCaptureZone", 25000, false,"i",playerid);
            CountTime[playerid] = SetTimerEx("CountDown", 1, false,"i", playerid);
            iCP[playerid] = Snakef;
            InCP[playerid][Snakef] = 1;
            Captured[Snakef] = 0;
            if(gTeam[playerid] == TEAM_ARMY)
            {
                GangZoneFlashForAll(Zone[Snakef], ARMY_COLOR);
            }
            else if(gTeam[playerid] == TEAM_TERRORIST)
            {
                GangZoneFlashForAll(Zone[Snakef], TERRORIST_COLOR);
            }
            new string[128], name[MAX_PLAYER_NAME+1];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string),"%s is trying to capture theSnakef",name);
            SendClientMessageToAll(ARMY_COLOR, string);
         }
      }
      return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == CP[Snakef])
    {
       if(Captured[Snakef] == 1)
       {
            GangZoneStopFlashForAll(Zone[Snakef]);
            UnderAttack[Snakef] = 0;
            InCP[playerid][Snakef] = 0;
            tCP[Snakef] = gTeam[playerid];
            if(gTeam[playerid] == TEAM_ARMY)
            {
                GangZoneShowForAll(Zone[Snakef], ARMY_COLOR);
            }
            else if(gTeam[playerid] == TEAM_TERRORIST)
            {
                GangZoneShowForAll(Zone[Snakef], TERRORIST_COLOR);
            }
            KillTimer(timer[playerid][Snakef]);
            KillTimer(CountTime[playerid]);
       }
       else if(Captured[Snakef] == 0)
       {
           SendClientMessage(playerid, TERRORIST_COLOR,"You have left the flag you have failed to capture the zone!");

}
forward CountDown(playerid);
public CountDown(playerid)
{
    CountVar[playerid]--;
    if(CountVar[playerid] == 0)
    {
      CountVar[playerid] = 25;
      KillTimer(CountTime[playerid]);
    }
    else
    {
        new str[124];
        format(str, sizeof(str),"~n~~n~~n~~n~~n~~n~~r~%d/~y~25 ~w~Seconds left~n~~g~to capture", CountVar[playerid]);
        GameTextForPlayer(playerid, str, 1000, 3);
    }
    CountTime[playerid] = SetTimerEx("CountDown", 1000, false,"i", playerid);
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Код:
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(59) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(60) : error 035: argument type mismatch (argument 1)
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(62) : error 001: expected token: ";", but found "-identifier-"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : error 001: expected token: ";", but found "-identifier-"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : error 017: undefined symbol "tCP"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : warning 215: expression has no effect
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Reply
#5

PHP код:
public OnGameModeInit()
{
CP[Snakef] = CreateDynamicCP(-34.5398,2350.1331,24.3026,5,0,0,-1,25);
Zone[Snakef] = GangZoneCreate(-96,2280,48,2406);
UnderAttack[Snakef] = -1;
Captured[Snakef] = -1;
tCP[Snakef] = TEAM_NONE;
    return 
1;

Reply
#6

Код:
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : error 017: undefined symbol "tCP"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : warning 215: expression has no effect
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : error 001: expected token: ";", but found "]"
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : error 029: invalid expression, assumed zero
D:\Documents and Settings\mijata_2.XPSP3-WBB\Desktop\hj.pwn(63) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#7

bump
Reply
#8

bump

line 63 :
Код:
tCP[Snakef] = TEAM_NONE;
Reply
#9

bump
Reply
#10

Make a global
pawn Код:
new tCP[30];
, but I tried it and it gave more errors on other lines beneath it..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)