2 annoying warnings
#1

This line is giving me 2 really annoying warnings:
pawn Код:
if (PLAYERLIST_authed[playerid]==0){
It's giving these 2 warnings:
Код:
C:\Users\Joni\Desktop\TDM\filterscripts\saving.pwn(83) : warning 225: unreachable code
C:\Users\Joni\Desktop\TDM\filterscripts\saving.pwn(83) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Whole part of the script i'm adding:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(login,5,cmdtext);
  dcmd(register,8,cmdtext);
  return 0;
 
    if (PLAYERLIST_authed[playerid]==0){
if (udb_Exists(PlayerName(playerid))){
SystemMsg(playerid,"You're not logged in yet.");
}

return 0;
}
    return 1;
}
dcmd's are all working fine, but under that all fucked -_- Tried everything. :/
Reply
#2

remove the return 0; after the dcmd's, the rest of the code needs to be executed, even if there ar no more commands. the only important return is the one directly before the end of the callback:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(login,5,cmdtext);
    dcmd(register,8,cmdtext);
    if (PLAYERLIST_authed[playerid]==0){
        if (udb_Exists(PlayerName(playerid))){
            SystemMsg(playerid,"You're not logged in yet.");
        }
    }
    return 1;
}
may i suggest you to use another command processor?
edit: maybe i broke your command by removing some returns, but dont hesitate to experiment with them
Reply
#3

It should be return 0, not 1.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)