Problems
#1

Code
Код:
if( PaintType[ killerid ] != 0 && PaintType[ playerid ] != 0 ) {
		PKills[ killerid ] ++; PDeaths[ playerid ] ++;
		SCMf( killerid, COLOR_CLIENT, "L-ai omorat pe %s cu un %s de la distanta de %0.2fm.", GetName( playerid ), weapName( reason ), GetDistanceBetweenPlayers( playerid, killerid ) );
		SCMf( playerid, COLOR_CLIENT, "Ai fost omorat de %s cu un %s de la distande de %0.2fm.", GetName( killerid ), weapName( reason ), GetDistanceBetweenPlayers( playerid, killerid ) );
		if( PaintType[ killerid ] == 3 && PaintType[ playerid ] == 3 ) {
			if( GetPaintLevel( playerid ) == 8 ) {
Line 555				foreach( new x : Player ) {
					if( PaintType[ x ] == PaintType[ killerid ] ) {
						for( new i = 0; i < 5; i++ ) SendDeathMessageToPlayer( x, 1001, 1001, 200 );
						SendPaintballMessage( PaintType[ x ] - 1, COLOR_YELLOW, "* %s a castigat runda deoarece a omorat pe %s cu un cutit.", GetName( killerid ), GetName( playerid ) );
						SpawnPlayer( x );
						PKills[ x ] = 0; PDeaths[ x ] = 0;
						PaintTime[ PaintType[ killerid ] - 1 ] = -2; PaintballWinner[ PaintType[ killerid ] - 1 ] = x; PaintballWinnerScore[ PaintType[ killerid ] - 1 ] = 0;
					}
				}
			} else GiveSkillWeapon( killerid );
			if( PaintTime[ PaintType[ killerid ] - 1 ] == -2 ) {
				if( PaintTimer[ PaintType[ killerid ] - 1 ] != 0 ) KillTimer( PaintTimer[ PaintType[ killerid ] - 1 ] ), PaintTimer[ PaintType[ killerid ] - 1 ] = 0;
				PaintTime[ PaintType[ killerid ] - 1 ] = -1; PaintText[ PaintType[ killerid ] - 1 ] = 60; PaintVote[ PaintType[ killerid ] - 1 ] = 1;
				PaintTimer[ PaintType[ killerid ] - 1 ] = SetTimerEx( "CalculateVote", 60000, false, "d", PaintType[ killerid ] - 1 );
				SendPaintballMessage( PaintType[ killerid ], COLOR_YELLOW, "Runda va incepe peste un minute. Pentru a vote o mapa, folositi comanda [/votemap]." );
			}
		}
		foreach( new x : Player ) { if( PaintType[ x ] == PaintType[ playerid ] ) SendDeathMessageToPlayer( x, killerid, playerid, reason ); }
		if( PKills[ killerid ] - PDeaths[ killerid ] > PaintballWinnerScore[ PaintType[ killerid ] - 1 ] ) PaintballWinner[ PaintType[ killerid ] - 1 ] = killerid, PaintballWinnerScore[ PaintType[ killerid ] - 1 ] = PlayerPaintballScore[ killerid ];
Error's
Код:
warning 219: local variable "x" shadows a variable at a preceding level (Line 555)
error 017: undefined symbol "Player" (Line 555)
error 017: undefined symbol "Player" (Line 555)
warning 215: expression has no effect (Line 555) 
error 001: expected token: ";", but found "]" (Line 555)
fatal error 107: too many error messages on one line (Line 555)
Reply
#2

Quote:
Originally Posted by MariusAdv
Посмотреть сообщение
Code
Код:
if( PaintType[ killerid ] != 0 && PaintType[ playerid ] != 0 ) {
		PKills[ killerid ] ++; PDeaths[ playerid ] ++;
		SCMf( killerid, COLOR_CLIENT, "L-ai omorat pe %s cu un %s de la distanta de %0.2fm.", GetName( playerid ), weapName( reason ), GetDistanceBetweenPlayers( playerid, killerid ) );
		SCMf( playerid, COLOR_CLIENT, "Ai fost omorat de %s cu un %s de la distande de %0.2fm.", GetName( killerid ), weapName( reason ), GetDistanceBetweenPlayers( playerid, killerid ) );
		if( PaintType[ killerid ] == 3 && PaintType[ playerid ] == 3 ) {
			if( GetPaintLevel( playerid ) == 8 ) {
Line 555				foreach( new x : Player ) {
					if( PaintType[ x ] == PaintType[ killerid ] ) {
						for( new i = 0; i < 5; i++ ) SendDeathMessageToPlayer( x, 1001, 1001, 200 );
						SendPaintballMessage( PaintType[ x ] - 1, COLOR_YELLOW, "* %s a castigat runda deoarece a omorat pe %s cu un cutit.", GetName( killerid ), GetName( playerid ) );
						SpawnPlayer( x );
						PKills[ x ] = 0; PDeaths[ x ] = 0;
						PaintTime[ PaintType[ killerid ] - 1 ] = -2; PaintballWinner[ PaintType[ killerid ] - 1 ] = x; PaintballWinnerScore[ PaintType[ killerid ] - 1 ] = 0;
					}
				}
			} else GiveSkillWeapon( killerid );
			if( PaintTime[ PaintType[ killerid ] - 1 ] == -2 ) {
				if( PaintTimer[ PaintType[ killerid ] - 1 ] != 0 ) KillTimer( PaintTimer[ PaintType[ killerid ] - 1 ] ), PaintTimer[ PaintType[ killerid ] - 1 ] = 0;
				PaintTime[ PaintType[ killerid ] - 1 ] = -1; PaintText[ PaintType[ killerid ] - 1 ] = 60; PaintVote[ PaintType[ killerid ] - 1 ] = 1;
				PaintTimer[ PaintType[ killerid ] - 1 ] = SetTimerEx( "CalculateVote", 60000, false, "d", PaintType[ killerid ] - 1 );
				SendPaintballMessage( PaintType[ killerid ], COLOR_YELLOW, "Runda va incepe peste un minute. Pentru a vote o mapa, folositi comanda [/votemap]." );
			}
		}
		foreach( new x : Player ) { if( PaintType[ x ] == PaintType[ playerid ] ) SendDeathMessageToPlayer( x, killerid, playerid, reason ); }
		if( PKills[ killerid ] - PDeaths[ killerid ] > PaintballWinnerScore[ PaintType[ killerid ] - 1 ] ) PaintballWinner[ PaintType[ killerid ] - 1 ] = killerid, PaintballWinnerScore[ PaintType[ killerid ] - 1 ] = PlayerPaintballScore[ killerid ];
Error's
Код:
warning 219: local variable "x" shadows a variable at a preceding level (Line 555)
error 017: undefined symbol "Player" (Line 555)
error 017: undefined symbol "Player" (Line 555)
warning 215: expression has no effect (Line 555) 
error 001: expected token: ";", but found "]" (Line 555)
fatal error 107: too many error messages on one line (Line 555)
Change
PHP код:
foreach( new Player 
to
PHP код:
foreach(Player,x
Reply
#3

Nope, same error's.
Reply
#4

Quote:
Originally Posted by MariusAdv
Посмотреть сообщение
Nope, same error's.
replace x with i, its shadowing x which means x already exists in the script or somewhere global.
u also have :
#include <foreach>
?
Reply
#5

I have #include <foreach>
Reply
#6

try

PHP код:
if( PaintTypekillerid ] != && PaintTypeplayerid ] != ) {
        
PKillskillerid ] ++; PDeathsplayerid ] ++;
        
SCMfkilleridCOLOR_CLIENT"L-ai omorat pe %s cu un %s de la distanta de %0.2fm."GetNameplayerid ), weapNamereason ), GetDistanceBetweenPlayersplayeridkillerid ) );
        
SCMfplayeridCOLOR_CLIENT"Ai fost omorat de %s cu un %s de la distande de %0.2fm."GetNamekillerid ), weapNamereason ), GetDistanceBetweenPlayersplayeridkillerid ) );
        if( 
PaintTypekillerid ] == && PaintTypeplayerid ] == ) {
            if( 
GetPaintLevelplayerid ) == ) {
                foreach( 
Player j) {
                    if( 
PaintType] == PaintTypekillerid ] ) {
                        for( new 
05i++ ) SendDeathMessageToPlayerj10011001200 );
                        
SendPaintballMessagePaintType] - 1COLOR_YELLOW"* %s a castigat runda deoarece a omorat pe %s cu un cutit."GetNamekillerid ), GetNameplayerid ) );
                        
SpawnPlayer);
                        
PKills] = 0PDeaths] = 0;
                        
PaintTimePaintTypekillerid ] - ] = -2PaintballWinnerPaintTypekillerid ] - ] = jPaintballWinnerScorePaintTypekillerid ] - ] = 0;
                    }
                }
            } else 
GiveSkillWeaponkillerid );
            if( 
PaintTimePaintTypekillerid ] - ] == -) {
                if( 
PaintTimerPaintTypekillerid ] - ] != KillTimerPaintTimerPaintTypekillerid ] - ] ), PaintTimerPaintTypekillerid ] - ] = 0;
                
PaintTimePaintTypekillerid ] - ] = -1PaintTextPaintTypekillerid ] - ] = 60PaintVotePaintTypekillerid ] - ] = 1;
                
PaintTimerPaintTypekillerid ] - ] = SetTimerEx"CalculateVote"60000false"d"PaintTypekillerid ] - );
                
SendPaintballMessagePaintTypekillerid ], COLOR_YELLOW"Runda va incepe peste un minute. Pentru a vote o mapa, folositi comanda [/votemap]." );
            }
        }
        foreach( 
Player ) { if( PaintType] == PaintTypeplayerid ] ) SendDeathMessageToPlayertkilleridplayeridreason ); }
        if( 
PKillskillerid ] - PDeathskillerid ] > PaintballWinnerScorePaintTypekillerid ] - ] ) PaintballWinnerPaintTypekillerid ] - ] = killeridPaintballWinnerScorePaintTypekillerid ] - ] = PlayerPaintballScorekillerid ]; 
Reply
#7

Do you have any variable named x anywhere in the script? If so, change foreach(Player, x) to foreach(new xLoop : Player). Then, for every x that is inside of that loop, replace with xLoop.

pawn Код:
foreach( new xLoop : Player) {
    if( PaintType[ j ] == PaintType[ killerid ] ) {
        for( new i = 0; i < 5; i++ ) SendDeathMessageToPlayer( xLoop, 1001, 1001, 200 );
            SendPaintballMessage( PaintType[ xLoop ] - 1, COLOR_YELLOW, "* %s a castigat runda deoarece a omorat pe %s cu un cutit.", GetName( killerid ), GetName( playerid ) );
            SpawnPlayer( xLoop );
            PKills[ xLoop ] = 0; PDeaths[ xLoop ] = 0;
            PaintTime[ PaintType[ killerid ] - 1 ] = -2; PaintballWinner[ PaintType[ killerid ] - 1 ] = xLoop; PaintballWinnerScore[ PaintType[ killerid ] - 1 ] = 0;
    } else GiveSkillWeapon( killerid );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)