Need help with Error 10.
#1

Hello again . I want to create Injured System, so here is my code
Код:
//
// SIMPLE INJURED SYSTEM
// BY: EDWARD VELKOV
// FOR SAMP 0.3X
// SERVER: ENERGY ROLEPLAY
// CREATED ON: 20.7.2013
//
//---------------------------------------------------------------//
#include <a_samp>
#include <core>
#include <float>
//--------------------------------------------------------------//
#define TogglePlayerControllable
#define GetPlayerHealth
#define phealth
//-------------------------------------------------------------//
public OnPlayerUpdate(playerid);


GetPlayerHealth(playerid,phealth);
if(phealth < 35)

	//fall animation
	TogglePlayerControllable(playerid,0);
	ApplyAnimation(playerid,"CRACK","crckidle2",1,0,0, 0,0,0);

	return 1;
}
..But when I try to compile it, it finds 4 errors -
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\GTA San Andreas\filterscripts\Anim.pwn(21) : error 010: invalid function or declaration
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\GTA San Andreas\filterscripts\Anim.pwn(22) : error 010: invalid function or declaration
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\GTA San Andreas\filterscripts\Anim.pwn(25) : error 010: invalid function or declaration
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\GTA San Andreas\filterscripts\Anim.pwn(2 : error 010: invalid function or declaration.

Any idea how to fix it?
Reply
#2

pawn Код:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
 new Float:phealth;
 GetPlayerHealth(playerid, phealth);
 if(phealth < 35.0)
 {
  TogglePlayerControllable(playerid, 0);
  ApplyAnimation(playerid, "CRACK", "crckidle2", 1, 0, 0, 0, 0, 0);
 }
 return 1;
}
Those defines were actually useless, you have that already defined by 'a_samp' include. Secondly ' 'public OnPlayerUpdate' is a callback which uses braces to declare the code under it. You just did it like performing functions. And phealth must be a variable which must be created and also as a 'Float' variable.
Reply
#3

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
pawn Код:
#include <a_samp>

public OnPlayerUpdate(playerid)
{
 new Float:phealth;
 GetPlayerHealth(playerid, phealth);
 if(phealth < 35.0)
 {
  TogglePlayerControllable(playerid, 0);
  ApplyAnimation(playerid, "CRACK", "crckidle2", 1, 0, 0, 0, 0, 0);
 }
 return 1;
}
Those defines were actually useless, you have that already defined by 'a_samp' include. Secondly ' 'public OnPlayerUpdate' is a callback which uses braces to declare the code under it. You just did it like performing functions. And phealth must be a variable which must be created and also as a 'Float' variable.
Thanks for your help. I will use this in future.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)