Have some problems with local variable x! Please help me out.
#1

PHP код:
public playerTabbedLoop() {
    foreach(
Playerx) { [B][I][U]//ERROR LINE![/U][/I][/B]
        
if(playerVariables[x][pTabbed] == && IsValidDynamic3DTextLabel(playerVariables[x][pAFKLabel]))
            
DestroyDynamic3DTextLabel(playerVariables[x][pAFKLabel]);
        
playerVariables[x][pConnectedSeconds] += 1;
        if(
playerVariables[x][pConnectedSeconds] < gettime()-&& playerVariables[x][pTabbed] != && playerVariables[x][pConnectedSeconds] >= && GetPlayerState(x) != && GetPlayerState(x) != && GetPlayerState(x) != 7) {
            
playerVariables[x][pTabbed] = 1;
            
playerVariables[x][pAFKLabel] = CreateDynamic3DTextLabel("Paused."COLOR_RED0007.5x_1___7.5);
        }
    }
    return 
1;

Error:
PHP код:
warning 219local variable "x" shadows a variable at a preceding level
warning 213
tag mismatch
warning 206
redundant testconstant expression is non-zero
error 022
must be lvalue (non-constant)
warning 215expression has no effect
error 001
expected token";"but found ")"
error 029invalid expressionassumed zero
fatal error 107
too many error messages on one line 
Please help me out.

With respect Scrillex.

Thanks for your time.
Reply
#2

Sorry, removed.
Reply
#3

I know that it's shadowing only.. but why the rest errors are there?

+Checked script no x what have been defined isn't there..

I think it's some kinda glich or something...

+ still same errors if I change it to your code!
Reply
#4

Maybe?

Код:
public playerTabbedLoop() {
    foreach(Player, x; { //ERROR LINE!
        if(playerVariables[x][pTabbed] == 0 && IsValidDynamic3DTextLabel(playerVariables[x][pAFKLabel]))
            DestroyDynamic3DTextLabel(playerVariables[x][pAFKLabel]);

        playerVariables[x][pConnectedSeconds] += 1;

        if(playerVariables[x][pConnectedSeconds] < gettime()-1 && playerVariables[x][pTabbed] != 1 && playerVariables[x][pConnectedSeconds] >= 5 && GetPlayerState(x) != 9 && GetPlayerState(x) != 0 && GetPlayerState(x) != 7) {
            playerVariables[x][pTabbed] = 1;
            playerVariables[x][pAFKLabel] = CreateDynamic3DTextLabel("Paused.", COLOR_RED, 0, 0, 0, 7.5, x, _, 1, _, _, _, 7.5);
        }
    }
    return 1;
}
Reply
#5

Yea what I did was obviously wrong that's why I removed it :/
Sorry.
Reply
#6

NOP! Still same! To _Khaled_ All okay mate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)