SA-MP Forums Archive
[HELP] script errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] script errors (/showthread.php?tid=343198)



[HELP] script errors - euro2cz - 16.05.2012

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;
}



Re: [HELP] script errors - Ballu Miaa - 16.05.2012

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;
}



Re: [HELP] script errors - euro2cz - 16.05.2012

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.



Re: [HELP] script errors - Ballu Miaa - 16.05.2012

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;
}



Re: [HELP] script errors - RedWingz - 16.05.2012

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.


Re: [HELP] script errors - euro2cz - 16.05.2012

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;
}



Re: [HELP] script errors - Ballu Miaa - 16.05.2012

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


Re: [HELP] script errors - RedWingz - 16.05.2012

Wow, +6 Reputation!
Thanks very much!


Re: [HELP] script errors - Ballu Miaa - 16.05.2012

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