SA-MP Forums Archive
error 029: invalid expression, assumed zero - 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: error 029: invalid expression, assumed zero (/showthread.php?tid=657436)



error 029: invalid expression, assumed zero - VGAassassin - 07.08.2018

(17244) : error 010: invalid function or declaration
(17253) : error 029: invalid expression, assumed zero
(17266) : error 010: invalid function or declaration

there's is code
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    new
        Float: health,
        Float:armour
    ;
    GetPlayerHealth(playerid, health); // Gets the health of the player that took damage, and stores it in the float "health".
    GetPlayerArmour(playerid, armour); // Gets the armour of the player that took damage, and stores it in the float "armour".

	switch(bodypart)
	{
  	case 3: SetPlayerHealth(playerid, health - 30); // Torso.
  	case 4: SetPlayerHealth(playerid, health - 20); // Groin.
  	case 5: SetPlayerHealth(playerid, health - 5);  // Left Arm.
  	case 6: SetPlayerHealth(playerid, health - 10); // Right Arm.
  	case 7: SetPlayerHealth(playerid, health - 7);  // Left Leg.
  	case 8: SetPlayerHealth(playerid, health - 12); // Right Leg.
  	case 9: SetPlayerHealth(playerid, health - 50); // Head.
	}
	return 1;
 	}

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
the Public onplayergivedamage it's last error


Re: error 029: invalid expression, assumed zero - VGAassassin - 07.08.2018

need help, please


Re: error 029: invalid expression, assumed zero - Jing_Chan - 07.08.2018

Show the exact lines of error in order to be helped.


Re: error 029: invalid expression, assumed zero - VGAassassin - 07.08.2018

Quote:
Originally Posted by Jing_Chan
Посмотреть сообщение
Show the exact lines of error in order to be helped.



Re: error 029: invalid expression, assumed zero - Jing_Chan - 07.08.2018

Quote:
Originally Posted by VGAassassin
Посмотреть сообщение
The code you've provided in this is different to the first post, can you provide me the code which is causing the errors?


Re: error 029: invalid expression, assumed zero - VGAassassin - 07.08.2018

Quote:
Originally Posted by Jing_Chan
Посмотреть сообщение
The code you've provided in this is different to the first post, can you provide me the code which is causing the errors?



Re: error 029: invalid expression, assumed zero - TadePoleMG - 07.08.2018

did you made it like this?
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
return 
1;

or not?


Re: error 029: invalid expression, assumed zero - VGAassassin - 07.08.2018

Quote:
Originally Posted by TadePoleMG
Посмотреть сообщение
did you made it like this?
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
return 
1;

or not?
yes i make it


Re: error 029: invalid expression, assumed zero - TadePoleMG - 07.08.2018

provide me full error codes with error lines.


Re: error 029: invalid expression, assumed zero - Florin48 - 07.08.2018

remove } after Float:armour and put ;