Unreachable Code -
Soulbad - 07.03.2012
Can anyone help me with these following issues pls?
pawn Code:
C:\Documents and Settings\Andrea\Desktop\SD CNR\filterscripts\LuxAdmin.pwn(362) : warning 235: public function lacks forward declaration (symbol "AfterPlayerConnect")
C:\Documents and Settings\Andrea\Desktop\SD CNR\filterscripts\LuxAdmin.pwn(370) : warning 235: public function lacks forward declaration (symbol "OnGetPlayerKeys")
C:\Documents and Settings\Andrea\Desktop\SD CNR\filterscripts\LuxAdmin.pwn(713) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Warnings.
Line 713 :
pawn Code:
if(ServerInfo[ConnectMessages] == 1)
{
new pAKA[256];
pAKA = dini_Get("LuxAdmin/Config/aka.txt",tmp3);
if (strlen(pAKA) < 3)
format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else if (!strcmp(pAKA,PlayerName,true))
format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else format(str,sizeof(str),"Player %s (Id:%d) has joined the server (Aka: %s)",PlayerName,playerid,pAKA);
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && playerid != i)
{
if(AccInfo[i][Level] > 2)
SendClientMessage(i,grey,str);
else
{
format(string,sizeof(string),"* Player %s (Id:%d) has joined the server", PlayerName, playerid);
SendClientMessage(i,grey,string);
}
}
}
If anyone can help me id give rep
Re: Unreachable Code -
Konstantinos - 07.03.2012
pawn Code:
// At The Top
forward AfterPlayerConnect(playerid);
forward OnGetPlayerKeys();
Re: Unreachable Code -
Soulbad - 07.03.2012
thanks you fixed my first 2 warnings, any idea how i can fix the unreachable code?
Re: Unreachable Code -
Konstantinos - 07.03.2012
Line?
Re: Unreachable Code -
Soulbad - 07.03.2012
line 713
Re: Unreachable Code -
Mark™ - 07.03.2012
pawn Code:
if(ServerInfo[ConnectMessages] == 1)
{
new pAKA[256];
pAKA = dini_Get("LuxAdmin/Config/aka.txt",tmp3);
if (strlen(pAKA) < 3)
format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else if (!strcmp(pAKA,PlayerName,true))
format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else format(str,sizeof(str),"Player %s (Id:%d) has joined the server (Aka: %s)",PlayerName,playerid,pAKA);
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && playerid != i)
{
if(AccInfo[i][Level] > 2)
SendClientMessage(i,grey,str);
else
{
format(string,sizeof(string),"* Player %s (Id:%d) has joined the server", PlayerName, playerid);
SendClientMessage(i,grey,string);
return 1;
}
}
return 0;
}
Re: Unreachable Code -
Konstantinos - 07.03.2012
Yes, but which is line 713 from this part?
pawn Code:
if(ServerInfo[ConnectMessages] == 1)
{
new pAKA[256];
pAKA = dini_Get("LuxAdmin/Config/aka.txt",tmp3);
if (strlen(pAKA) < 3) format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else if (!strcmp(pAKA,PlayerName,true)) format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else format(str,sizeof(str),"Player %s (Id:%d) has joined the server (Aka: %s)",PlayerName,playerid,pAKA);
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && playerid != i) {
if(AccInfo[i][Level] > 2)
SendClientMessage(i,grey,str);
else {
format(string,sizeof(string),"* Player %s (Id:%d) has joined the server", PlayerName, playerid);
SendClientMessage(i,grey,string);
}
}
}
Re: Unreachable Code -
Soulbad - 07.03.2012
it still is saying unreachable code :/
Re: Unreachable Code -
Mark™ - 07.03.2012
post the line 713 from that code then
Re: Unreachable Code -
Soulbad - 07.03.2012
pawn Code:
//BEFORE LINE 715 (added forwards so its 715 now)
public OnPlayerConnect(playerid)
{
#if EnableCamHack == true
KeyState[playerid] = 0;
FollowOn[playerid] = 0;
AccInfo[playerid][InCamMod] = 0;
AccInfo[playerid][LockedCam] = 0;
#endif
AccInfo[playerid][Deaths] = 0;
AccInfo[playerid][Kills] = 0;
AccInfo[playerid][Jailed] = 0;
AccInfo[playerid][Frozen] = 0;
AccInfo[playerid][Level] = 0;
AccInfo[playerid][pVip] = 0;
AccInfo[playerid][LoggedIn] = 0;
AccInfo[playerid][Registered] = 0;
AccInfo[playerid][God] = 0;
AccInfo[playerid][GodCar] = 0;
AccInfo[playerid][TimesSpawned] = 0;
AccInfo[playerid][Muted] = 0;
AccInfo[playerid][MuteWarnings] = 0;
AccInfo[playerid][Warnings] = 0;
AccInfo[playerid][Caps] = 0;
AccInfo[playerid][DoorsLocked] = 0;
AccInfo[playerid][pCar] = -1;
AccInfo[playerid][SpamCount] = 0;
AccInfo[playerid][MaxAdv] = 0;
AccInfo[playerid][SpamTime] = 0;
AccInfo[playerid][PingCount] = 0;
AccInfo[playerid][PingTime] = 0;
AccInfo[playerid][FailLogin] = 0;
AccInfo[playerid][Hide] = 0;
AccInfo[playerid][pInvis] = 0;
AccInfo[playerid][OnDuty] = 0;
AccInfo[playerid][pGps] = -1;
#if EnableTwoRcon == true
AccInfo[playerid][MaxRcon] = 0;
#endif
AccInfo[playerid][ConnectTime] = gettime();
for(new i; i<PING_MAX_EXCEEDS; i++)
AccInfo[playerid][pPing][i] = 0;
//------------------------------------------------------
new string[128];
new str[128];
new file[256];
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
SetTimerEx("AfterPlayerConnect", 1000, 0, "i", playerid);
ResetForbiddenWeaponsForPlayer(playerid);
TempBanCheck(playerid);
return 1;
//==============================================================================
// Connect Messages -- Line 715 onwards, more if's after it
//==============================================================================
if(ServerInfo[ConnectMessages] == 1)
{
new pAKA[256];
pAKA = dini_Get("LuxAdmin/Config/aka.txt",tmp3);
if (strlen(pAKA) < 3)
format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else if (!strcmp(pAKA,PlayerName,true))
format(str,sizeof(str),"* Player %s (Id:%d) has joined the server", PlayerName,playerid);
else format(str,sizeof(str),"Player %s (Id:%d) has joined the server (Aka: %s)",PlayerName,playerid,pAKA);
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && playerid != i)
{
if(AccInfo[i][Level] > 2)
SendClientMessage(i,grey,str);
else
{
format(string,sizeof(string),"* Player %s (Id:%d) has joined the server", PlayerName, playerid);
SendClientMessage(i,grey,string);
return 1;
}
}
return 0;
}