Help please [PLEASE :D] [+rep] -
vassilis - 15.11.2011
Well guys according to blackworlf's map changing system tutorial what is wrong because it shows me 4 errors in the same line :P
here is the code :P
pawn Код:
public Restart(playerid,classid)
{
//GameTextForPlayer(playerid, "if you been teleported,its working",5000,5);
switch (CurrentMap)
{
case 0:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid, 716.8705,-2308.6211,107.9117);
}
case 2:
{
SetPlayerPos(playerid,684.1284,-2409.9363,107.1745);
}
}
}
CurrentMap = 1;
SendRconCommand("mapname cs_italy");
}
case 1:
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid,4427.6431,-1640.7981,22.3554);
}
case 2:
{
SetPlayerPos(playerid, 4354.7001, -1682.3000, 25.5);
}
CurrentMap = 2;
SendRconCommand("mapname de_dust2");
}
}
}
}
return 1;
}
PHP код:
errors:
(1944) : error 014: invalid statement; not in switch
(1944) : warning 215: expression has no effect
(1944) : error 001: expected token: ";", but found ":"
(1944) : error 029: invalid expression, assumed zero
(1944) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Note: line 1944 is this one
:
Re: According to this.. -
Elka_Blazer - 15.11.2011
Notice that on your public there are
13 {
and only 12 }
FIX:
pawn Код:
public Restart(playerid,classid)
{
//GameTextForPlayer(playerid, "if you been teleported,its working",5000,5);
switch (CurrentMap)
{
case 0:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid, 716.8705,-2308.6211,107.9117);
}
case 2:
{
SetPlayerPos(playerid,684.1284,-2409.9363,107.1745);
}
}
}
}
}
CurrentMap = 1;
SendRconCommand("mapname cs_italy");
case 1:
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid,4427.6431,-1640.7981,22.3554);
}
case 2:
{
SetPlayerPos(playerid, 4354.7001, -1682.3000, 25.5);
}
CurrentMap = 2;
SendRconCommand("mapname de_dust2");
}
}
}
}
return 1;
}
Re: According to this.. -
Kostas' - 15.11.2011
You forgot a "}"
Change it to
pawn Код:
public Restart(playerid,classid)
{
//GameTextForPlayer(playerid, "if you been teleported,its working",5000,5);
switch (CurrentMap)
{
case 0:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid, 716.8705,-2308.6211,107.9117);
}
case 2:
{
SetPlayerPos(playerid,684.1284,-2409.9363,107.1745);
}
}
}
CurrentMap = 1;
SendRconCommand("mapname cs_italy");
}
}
case 1:
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid,4427.6431,-1640.7981,22.3554);
}
case 2:
{
SetPlayerPos(playerid, 4354.7001, -1682.3000, 25.5);
}
CurrentMap = 2;
SendRconCommand("mapname de_dust2");
}
}
}
}
return 1;
}
Re: According to this.. -
vassilis - 15.11.2011
nice now it is extended to 6 errors ..
pawn Код:
(1939) : error 002: only a single statement (or expression) can follow each "case"
(1939) : error 029: invalid expression, assumed zero
(1939) : warning 215: expression has no effect
(1941) : error 014: invalid statement; not in switch
(1941) : warning 215: expression has no effect
(1941) : error 001: expected token: ";", but found ":"
(1941) : error 029: invalid expression, assumed zero
(1941) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
Re: According to this.. -
Elka_Blazer - 15.11.2011
Line 1939 and 1941 ?
This forum requires that you wait 120 seconds between posts. Please try again in 86 seconds.
FUCK YOU
This forum requires that you wait 120 seconds between posts. Please try again in 57 seconds.
FUCK YOU AGAIN
Re: According to this.. -
vassilis - 15.11.2011
1939:
1941:
Re: According to this.. -
Elka_Blazer - 15.11.2011
Maybe this
pawn Код:
public Restart(playerid,classid)
{
//GameTextForPlayer(playerid, "if you been teleported,its working",5000,5);
switch (CurrentMap)
{
case 0:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid, 716.8705,-2308.6211,107.9117);
}
case 2:
{
SetPlayerPos(playerid,684.1284,-2409.9363,107.1745);
}
}
}
}
CurrentMap = 1;
SendRconCommand("mapname cs_italy");
}
case 1:
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid,4427.6431,-1640.7981,22.3554);
}
case 2:
{
SetPlayerPos(playerid, 4354.7001, -1682.3000, 25.5);
}
}
}
}
CurrentMap = 2;
SendRconCommand("mapname de_dust2");
}
return 1;
}
BTW On case1 you forget to add a loop !
Re: According to this.. -
Kostas' - 15.11.2011
Did you try this I posted before?
Re: According to this.. -
Elka_Blazer - 15.11.2011
BTW On case1 you forget to add a loop !
So many mistakes here ...
If thats not gonna fix this then I dont know what will...
pawn Код:
public Restart(playerid,classid)
{
//GameTextForPlayer(playerid, "if you been teleported,its working",5000,5);
switch (CurrentMap)
{
case 0:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid, 716.8705,-2308.6211,107.9117);
}
case 2:
{
SetPlayerPos(playerid,684.1284,-2409.9363,107.1745);
}
}
}
}
CurrentMap = 1;
SendRconCommand("mapname cs_italy");
}
case 1:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
SetPlayerPos(playerid, 716.8705,-2308.6211,107.9117);
}
case 2:
{
SetPlayerPos(playerid,684.1284,-2409.9363,107.1745);
}
}
}
}
CurrentMap = 2;
SendRconCommand("mapname de_dust2");
}
return 1;
}
Re: According to this.. -
vassilis - 15.11.2011
5 errors... :P
pawn Код:
edit the error is here: CurrentMap = 2;