if.... not detected ???
#1

PHP код:
                if(pInfo[playerid][Banned] == 1){
                    
SendClientMessage(playerid, -1"{800000}Your account is restricted from playing.");
                    
SetTimerEx("OfflineBan"1000false"i"playerid);}
                        
                  if(
pInfo[playerid][Admin] > 0){
                    
format(str2,sizeof(str2), "{4d79ff}(auth) You successfully authed as %s! (level: %d)",PlayerName[playerid], pInfo[playerid][Admin]);
                    
SendClientMessage(playerid, -1str2);
                 }else{
                    
format(str2,sizeof(str2), "{4d79ff}(auth) You successfully authed as %s!",PlayerName[playerid]);
                    
SendClientMessage(playerid, -1str2);} 
Why nothing is detected?...
Reply
#2

I expect that once the enum Banned is returned to 1 it should automatically ban the player with a message, same for the one if Admin is different than 0 it should tell you a different auth message. Why is this not working? i'm almost raping my keyboard on finding ways to make this work, but without any success. The "IF" state is not properly working and doesn't really find anything...
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
The if might succeed, but then the other code is still run. You need an `else if` after the ban check, or a `return` within in, both prevent further processing.
Not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)