help, checkpointfeature, don't know how to do!
#1

ok I want that if you enter a Checkpoint
something like mine:
Код:
blabla ifplayerentercheckpoint:
WinCP1 =0; gets set to: winCP1 =1;

and then further in the script somewhere like:
if (WinCP1 =1;)
{
SendRconMessage(changemode mygamemode);
and yes i did: new WinCP1 =0; on top
but the error sais: unreachable code
and i defined the CP too
Reply
#2

What's the problem exactly? If you just want someone to do it for you go to the Script Request Thread
Reply
#3

in my gamemode there are 2 teams:
1 has to defend the checkpoin
the other has to claim it.
so when someone gets in the checkpoint of that team
They win the game, and up to the next gamemode

Код:
// On top:
#define MAX_POINTS 8
// checkpoints
#define CP_ammo1  0
#define CP_ammo2  1
#define CP_pipeTP  2
#define CP_winCP1  3
#define CP_winCP2  4
#define CP_winCP3  5
#define CP_winCP4  6
#define CP_winCP5  7

new playerCheckpoint[MAX_PLAYERS];
new WinCP1 =0;
new WinCP2 =0;
new WinCP3 =0;
new WinCP4 =0;
new WinCP5 =0;

new Float:checkCoords[MAX_POINTS][4] = {
{-2358.6116,-1628.2495, -2338.6116,-1608.2495}, // ammo 1
{-2533.3220,-1670.0131, -2513.3220,-1650.0131},  // ammo 2
{-2496.6479,-1715.9719, -2476.6479,-1695.9719}, // pipe TP 3
{-2345.3818,-1604.4388, -2325.3818,-1584.4388}, //winCP1
{-2366.6287,-1643.5525, -2346.6287,-1623.5525}, // 
{-2269.5081,-1707.9636, -2249.5081,-1687.9636}, // 
{-2350.3823,-1681.2062, -2330.3823,-1661.2062}, // 
{-2305.7007,-1661.3547 , -2285.7007,-1641.3547} // winCP5

//als je checkpoints wilt toevoegen, zet je een komma achter de laatste coordinaten en voeg je hier een extra regel onder zonder komma erachter.

};

new Float:checkpoints[MAX_POINTS][4] = {
{-2348.6116,-1618.2495,483.6502,5.0},
{-2523.3220,-1660.0131,405.2716,5.0},
{-2486.6479,-1705.9719,423.9576,5.0},
{-2335.3818,-1594.4388,483.6819,5.0},
{-2356.6287,-1633.5525,483.6950,5.0},
{-2259.5081,-1697.9636,480.3884,5.0},
{-2340.3823,-1671.2062,496.9150,5.0},
{-2295.7007,-1651.3547,483.3819 ,5.0}
};

new checkpointType[MAX_POINTS] = {
CP_ammo1,
CP_ammo2,
CP_pipeTP,
CP_winCP1,
CP_winCP2,
CP_winCP3,
CP_winCP4,
CP_winCP5
};

// so that are my checkpoints and something I need to let the team win.

// at ongamemodeinit
WinCP1 =0;
WinCP2 =0;
WinCP3 =0;
WinCP4 =0;
WinCP5 =0;

// at onplayerentercheckpoint

  	if(getCheckpointType(playerid) == CP_winCP1)
  	{
  	if(gTeam[playerid] == TEAM_TERROR)
  	{
  	if(WinCP1 == 0)
  	{
WinCP1 =1;
	return 1;
	}
	}
	}
Now it says unreachable code on the red line
so what's wrong..?
and I haven't go further yet but I was putting this for every checkpoint so they need to claim 5 checkpoints

[EDIT]
Nevermind I think I have fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)