SA-MP Forums Archive
return error on side health? - 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: return error on side health? (/showthread.php?tid=627545)



return error on side health? - kloning1 - 29.01.2017

return error? any one can help me to fix that?
. thanks before

Код:
stock GetPlayerDarah(playerid) 
{
	return PlayerInfo[playerid][pHealth];// line 2110
}
stock SetPlayerDarah(playerid, Float:amount)
{
	PlayerInfo[playerid][pHealth] = amount;
	return SetPlayerHealth(playerid, amount);
}
get error
Код:
Process started >>>
anehaneh.pwn(2110) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
<<< Process finished. (Exit code 0)
================ READY ================



Re: return error on side health? - SilentSoul - 29.01.2017

Make sure you have it like this in your enum.
pawn Код:
enum p_info
{
    Float:pHealth//<< this
};
new PlayerInfo[MAX_PLAYERS][p_info]



Re: return error on side health? - GoldenLion - 29.01.2017

Код:
stock Float:GetPlayerDarah(playerid) 
{
	return PlayerInfo[playerid][pHealth];// line 2110
}
You must add the "Float" tag if the function returns a float.


Re: return error on side health? - kloning1 - 29.01.2017

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
Make sure you have it like this in your enum.
pawn Код:
enum p_info
{
    Float:pHealth//<< this
};
new PlayerInfo[MAX_PLAYERS][p_info]
Already added on top script

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Код:
stock Float:GetPlayerDarah(playerid) 
{
	return PlayerInfo[playerid][pHealth];// line 2110
}
You must add the "Float" tag if the function returns a float.
get error
Код:
gamebaru.pwn(2108) : warning 208: function with tag result used before definition, forcing reparse
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: return error on side health? - GoldenLion - 29.01.2017

Quote:
Originally Posted by kloning1
Посмотреть сообщение
Already added on top script



get error
Код:
gamebaru.pwn(2108) : warning 208: function with tag result used before definition, forcing reparse
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
It took me a few seconds to ******. Read what Vince said: https://sampforum.blast.hk/showthread.php?tid=359341