SA-MP Forums Archive
Help with Zombie FCNPC Include. - 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 with Zombie FCNPC Include. (/showthread.php?tid=637723)



Help with Zombie FCNPC Include. - MarkNelson - 20.07.2017

Hello everyone, first of all i want to say "thank you" for taking time to view my topic.
Alright listen, Today i decided to update my server, So i wanted to add zombie NPCs using FCNPC Include and Plugin.
everything works fine but when i tried to compile my GameMode Script again, i faced some errors but i don't know how to fix them, i searched in ****** too and no results.
So, i decided to ask for help from SAMP FORUMS.
here is the errors while compiling:
PHP Code:
C:\Users\cpt\Desktop\Script Package\pawno\include\FCNPC.inc(282) : warning 202number of arguments does not match definition
C
:\Users\cpt\Desktop\Script Package\pawno\include\FCNPC.inc(295) : error 025: function heading differs from prototype 
and here are the lines in FCNPC include :
This is line 282
PHP Code:
return FCNPC_OnPlayerTakeDamage(playeridissueridamountweaponidbodypart); 
and here is line 295:
PHP Code:
forward FCNPC_OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart); 
i hope you'll help me guys


Re: Help with Zombie FCNPC Include. - Amads - 20.07.2017

Code:
FCNPC_OnTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss)



Re: Help with Zombie FCNPC Include. - MarkNelson - 20.07.2017

Quote:
Originally Posted by Amads
View Post
Code:
FCNPC_OnTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss)
Thanks! but look
PHP Code:
warning 235: public function lacks forward declaration (symbol "FCNPC_OnPlayerTakeDamage")
error 004: function "FCNPC_OnTakeDamage" is not implemented 



Re: Help with Zombie FCNPC Include. - Amads - 20.07.2017

Code:
forward FCNPC_OnTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss);
public FCNPC_OnTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss)
{
	// code
	return 1;
}



Re: Help with Zombie FCNPC Include. - MarkNelson - 20.07.2017

you just did a mistake you forget to type "Player"
it's like this
"FCNPC_OnPlayerTakeDamage"
PHP Code:
error 025: function heading differs from prototype
error 017
undefined symbol "damagerid"
error 025: function heading differs from prototype 
Line 279 :
PHP Code:
public OnPlayerTakeDamage(npcid,playeridissueridFloat:amountweaponidbodypart//This is the line 279
{
    
#if defined FCNPC_OnPlayerTakeDamage
        
return FCNPC_OnPlayerTakeDamage(npciddamageridweaponidbodypartFloat:health_loss); //This is 282
    #else
        
return 1;
    
#endif

and here is LINE 295 :
PHP Code:
    forward FCNPC_OnPlayerTakeDamage(npciddamageridweaponidbodypartFloat:health_loss); 



Re: Help with Zombie FCNPC Include. - Toroi - 20.07.2017

Code:
return FCNPC_OnPlayerTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss);
damagerid should be passed with the variable issuerid under OnPlayerTakeDamage


Re: Help with Zombie FCNPC Include. - MarkNelson - 20.07.2017

Quote:
Originally Posted by Toroi
View Post
Code:
return FCNPC_OnPlayerTakeDamage(npcid, damagerid, weaponid, bodypart, Float:health_loss);
damagerid should be passed with the variable issuerid under OnPlayerTakeDamage
thank you so much , my problem is already solved but special thanks to you and Amads