#1

if(strcmp("/capture", cmdtext, true, 10) == 0)
{
if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
if(PlayerInfo[playerid][gangid] == 0) return SendClientMessage(playerid,COLORE_ROSSO,"ERROR:You are not in any gang.");
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383)//gang 1
if(Count <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
{
Count = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang1, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang1, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimer[playerid]);
MyTimer[playerid] = SetTimerEx("TestFunction", 1000, 1, "i", playerid);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1104.9656, 992.6399, 30.7290))//gang 2
if(Counta <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
{
Counta = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang2, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang2, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimera[playerid]);
MyTimera[playerid] = SetTimerEx("TestFunctiona", 1000, 1, "i", playerid);
}
return 1;
}

What make this warn "warning 225: unreachable code"
Reply
#2

Where's the line of the warning?
Reply
#3

Quote:
Originally Posted by LMaxCo
Посмотреть сообщение
Where's the line of the warning?
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1104.9656, 992.6399, 30.7290))//gang 2
Reply
#4

Try this

Код:
if(strcmp("/capture", cmdtext, true, 10) == 0)
{
if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
if(PlayerInfo[playerid][gangid] == 0) return SendClientMessage(playerid,COLORE_ROSSO,"ERROR:You are not in any gang.");
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383)//gang 1
if(Count <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
{
Count = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang1, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang1, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimer[playerid]);
MyTimer[playerid] = SetTimerEx("TestFunction", 1000, 1, "i", playerid);
return 1;
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1104.9656, 992.6399, 30.7290))//gang 2
if(Counta <= 19) 
return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
}
Counta = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang2, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang2, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimera[playerid]);
MyTimera[playerid] = SetTimerEx("TestFunctiona", 1000, 1, "i", playerid);
}
return 1;
}
Reply
#5

Try this code, missing brackets.
Код:
if(strcmp("/capture", cmdtext, true, 10) == 0)
{
if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
if(PlayerInfo[playerid][gangid] == 0) return SendClientMessage(playerid,COLORE_ROSSO,"ERROR:You are not in any gang.");
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383)//gang 1
{
if(Count <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
Count = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang1, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang1, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimer[playerid]);
MyTimer[playerid] = SetTimerEx("TestFunction", 1000, 1, "i", playerid);
}
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1104.9656, 992.6399, 30.7290))//gang 2
{
if(Counta <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
Counta = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang2, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang2, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimera[playerid]);
MyTimera[playerid] = SetTimerEx("TestFunctiona", 1000, 1, "i", playerid);
}
return 1;
}
And you forgot to add ")" on :
Код:
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383)//gang 1
Reply
#6

Код:
if(Count <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
{
This is never going to work
Reply
#7

Quote:
Originally Posted by bondowocopz
Посмотреть сообщение
Try this code, missing brackets.
Код:
if(strcmp("/capture", cmdtext, true, 10) == 0)
{
if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
if(PlayerInfo[playerid][gangid] == 0) return SendClientMessage(playerid,COLORE_ROSSO,"ERROR:You are not in any gang.");
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383)//gang 1
{
if(Count <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
Count = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang1, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang1, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimer[playerid]);
MyTimer[playerid] = SetTimerEx("TestFunction", 1000, 1, "i", playerid);
}
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1104.9656, 992.6399, 30.7290))//gang 2
{
if(Counta <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
Counta = 20;
if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang2, 0xFFFFFF96);
if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang2, 0x80000096);
if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
KillTimer(MyTimera[playerid]);
MyTimera[playerid] = SetTimerEx("TestFunctiona", 1000, 1, "i", playerid);
}
return 1;
}
And you forgot to add ")" on :
Код:
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383)//gang 1
C:\Users\DAVIDE\Desktop\ise\gamemodes\dm.pwn(5524) : warning 217: loose indentation
C:\Users\DAVIDE\Desktop\ise\gamemodes\dm.pwn(5529) : error 001: expected token: ")", but found "{"
C:\Users\DAVIDE\Desktop\ise\gamemodes\dm.pwn(5552) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

You've missed another ) somewhere on the line mentioned, or the one prior.

Clean up those indentation errors as well, and you'll probably see it better.
Reply
#9

Quote:
Originally Posted by BlackEvils
Посмотреть сообщение
C:\Users\DAVIDE\Desktop\ise\gamemodes\dm.pwn(5524) : warning 217: loose indentation
C:\Users\DAVIDE\Desktop\ise\gamemodes\dm.pwn(5529) : error 001: expected token: ")", but found "{"
C:\Users\DAVIDE\Desktop\ise\gamemodes\dm.pwn(5552) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Fixed ")" with better indentation.
Код:
if(strcmp("/capture", cmdtext, true, 10) == 0)
{
	if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
	if(PlayerInfo[playerid][gangid] == 0) return SendClientMessage(playerid,COLORE_ROSSO,"ERROR:You are not in any gang.");
	if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383))//gang 1
	{
		if(Count <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
		Count = 20;
		if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang1, 0xFFFFFF96);
		if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang1, 0x80000096);
		if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		KillTimer(MyTimer[playerid]);
		MyTimer[playerid] = SetTimerEx("TestFunction", 1000, 1, "i", playerid);
	}
	if(IsPlayerInRangeOfPoint(playerid, 10.0, 1104.9656, 992.6399, 30.7290))//gang 2
	{
		if(Counta <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
		Counta = 20;
		if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang2, 0xFFFFFF96);
		if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang2, 0x80000096);
		if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		KillTimer(MyTimera[playerid]);
		MyTimera[playerid] = SetTimerEx("TestFunctiona", 1000, 1, "i", playerid);
	}
	return 1;
}
Reply
#10

Quote:
Originally Posted by bondowocopz
Посмотреть сообщение
Fixed ")" with better indentation.
Код:
if(strcmp("/capture", cmdtext, true, 10) == 0)
{
	if(InDm[playerid] >= 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR:You can't use this command in a dm/event.");
	if(PlayerInfo[playerid][gangid] == 0) return SendClientMessage(playerid,COLORE_ROSSO,"ERROR:You are not in any gang.");
	if(IsPlayerInRangeOfPoint(playerid, 10.0, 1975.5731, -1249.5286, 20.383))//gang 1
	{
		if(Count <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
		Count = 20;
		if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang1, 0xFFFFFF96);
		if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang1, 0x80000096);
		if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		KillTimer(MyTimer[playerid]);
		MyTimer[playerid] = SetTimerEx("TestFunction", 1000, 1, "i", playerid);
	}
	if(IsPlayerInRangeOfPoint(playerid, 10.0, 1104.9656, 992.6399, 30.7290))//gang 2
	{
		if(Counta <= 19) return SendClientMessage(playerid, COLORE_ROSSO, "ERROR:This gang is already under capture.");
		Counta = 20;
		if(PlayerInfo[playerid][gangid] == 1)GangZoneFlashForAll(gang2, 0xFFFFFF96);
		if(PlayerInfo[playerid][gangid] == 1)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		if(PlayerInfo[playerid][gangid] == 2)GangZoneFlashForAll(gang2, 0x80000096);
		if(PlayerInfo[playerid][gangid] == 2)SendClientMessage(playerid, COLORE_VERDE, "INFO:Capture started wait 20 seconds for capture this territory.");
		KillTimer(MyTimera[playerid]);
		MyTimera[playerid] = SetTimerEx("TestFunctiona", 1000, 1, "i", playerid);
	}
	return 1;
}
thx you !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)