[HELP] script errors
#1

Hi, I get some errors and i can't fix it pls somebody help me
errors:
Код:
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5753) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5753) : warning 221: label name "Float" shadows tag name
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5753) : error 017: undefined symbol "healHP"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5753) : warning 215: expression has no effect
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5754) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5756) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5758) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5760) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5762) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5767) : error 017: undefined symbol "healHP"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5769) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5771) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5773) : error 017: undefined symbol "i"
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5753) : warning 203: symbol is never used: "Float"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


11 Errors.
Код:
public zombtimer(playerid)
{
    for(new i=0; i<MAX_PLAYERS_EX; i++)
    new Float:healHP;
	GetPlayerHealth(i, healHP);
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.0, -1701.426757,684.093688,18.226135))
            {
                if(zombie[i] == 0)
				{
				GivePlayerHealth(i,-5);
				}
            }
        }
    }
	if(healHP < 20)
	{
		if(IsPlayerConnected(i))
		{
				if(zombie[i] == 0)
				{
				zombie[i] = 1;
				}
		}
	}
	return 1;
}
Reply
#2

Uhmm try out this one then.
pawn Код:
public zombtimer(playerid)
{
    for(new i=0; i<MAX_PLAYERS_EX; i++)
    {
        new Float:healHP;
        GetPlayerHealth(i, healHP);
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.0, -1701.426757,684.093688,18.226135))
            {
                if(zombie[i] == 0)
                {
                GivePlayerHealth(i,-5);
                }
            }
        }
    }
    if(healHP < 20)
    {
        if(IsPlayerConnected(i))
        {
                if(zombie[i] == 0)
                {
                zombie[i] = 1;
                }
        }
    }
    return 1;
}
Reply
#3

Thanks , but now i get only 1 error :
Код:
C:\Users\Renek\Documents\samp03e_svr_win32\gamemodes\worldgta.pwn(5769) : error 017: undefined symbol "healHP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Use this one then now.

pawn Код:
public zombtimer(playerid)
{
    new Float:healHP;
    for(new i=0; i<MAX_PLAYERS_EX; i++)
    {
        GetPlayerHealth(i, healHP);
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.0, -1701.426757,684.093688,18.226135))
            {
                if(zombie[i] == 0)
                {
                    GivePlayerHealth(i,healHP-5);
                }
            }
        }
    }
    if(healHP < 20)
    {
        if(IsPlayerConnected(i))
        {
                if(zombie[i] == 0)
                {
                    zombie[i] = 1;
                }
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Use this one then now.

pawn Код:
public zombtimer(playerid)
{
    new Float:healHP;
    for(new i=0; i<MAX_PLAYERS_EX; i++)
    {
        GetPlayerHealth(i, healHP);
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.0, -1701.426757,684.093688,18.226135))
            {
                if(zombie[i] == 0)
                {
                    GivePlayerHealth(i,healHP-5);
                }
            }
        }
    }
    if(healHP < 20)
    {
        if(IsPlayerConnected(i))
        {
                if(zombie[i] == 0)
                {
                    zombie[i] = 1;
                }
        }
    }
    return 1;
}
This was what I was going to post... -__-
And yea, This should work, But if not, Then I don't know what the problem is...
Hope it helps.
Reply
#6

BIG THX
this is without errors and warnings:
Код:
public zombtimer(playerid)
{
    new Float:healHP;
    for(new i=0; i<MAX_PLAYERS_EX; i++)
    {
        GetPlayerHealth(i, healHP);
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.0, -1701.426757,684.093688,18.226135))
            {
                if(zombie[i] == 0)
                {
                    GivePlayerHealth(i,healHP-5);
                }
            }
        }
    }
    for(new i=0; i<MAX_PLAYERS_EX; i++)
    if(healHP < 20)
    {
        if(IsPlayerConnected(i))
        {
                if(zombie[i] == 0)
                {
                    zombie[i] = 1;
                }
        }
    }
    return 1;
}
Reply
#7

Cool xD Added Rep +6 to RedWingz for showing interest in helping others.
Reply
#8

Wow, +6 Reputation!
Thanks very much!
Reply
#9

Quote:
Originally Posted by RedWingz
Посмотреть сообщение
Wow, +6 Reputation!
Thanks very much!
All good fella'. Peace
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)