SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/05/2014, 01:44 PM   #1
Syncro
Little Clucker
 
Syncro's Avatar
 
Join Date: Jan 2014
Posts: 32
Reputation: 0
Default Problem with OnPlayerTakeDamage

Code:
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(weaponid == 0 && GetPVarInt(issuerid, "Tazer") == 1)
	{
	    SetPlayerHealth(playerid, GetPlayerHealth(playerid) - 10);
	    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 0, 0, 1, 30000, 1);
		return 1;
	)
}
I have a error with that code: "function differs from prototype".
I tryed:
- Download SA-MP Includes for 0.3z (not solved)
- Download YSI for 0.3z RC5 (not solved)
- Download YSI for 0.3z RC4 (not solved)
- Manually replace all the codes for fix in YSI files (not solved).

I need help please guys
Syncro is offline   Reply With Quote
Old 03/05/2014, 02:08 PM   #2
iZN
High-roller
 
Join Date: Jun 2010
Posts: 2,369
Reputation: 569
Default Re: Problem with OnPlayerTakeDamage

Are you sure other includes are updated too? Open them and see if they've the older version of that callback.
iZN is offline   Reply With Quote
Old 03/05/2014, 02:33 PM   #3
Syncro
Little Clucker
 
Syncro's Avatar
 
Join Date: Jan 2014
Posts: 32
Reputation: 0
Default Re: Problem with OnPlayerTakeDamage

Yes, all includes are updated, i've readed online that is for YSI, but I've updated YSI!
Syncro is offline   Reply With Quote
Old 03/05/2014, 03:46 PM   #4
Basssiiie
Gangsta
 
Basssiiie's Avatar
 
Join Date: Mar 2011
Location: The Netherlands
Posts: 758
Reputation: 191
Default Re: Problem with OnPlayerTakeDamage

Why are you forwarding a native callback? You don't have to do that.
Basssiiie is offline   Reply With Quote
Old 03/05/2014, 08:38 PM   #5
Syncro
Little Clucker
 
Syncro's Avatar
 
Join Date: Jan 2014
Posts: 32
Reputation: 0
Default Re: Problem with OnPlayerTakeDamage

Ok but the function with or without the forward not function, please help me!
Syncro is offline   Reply With Quote
Old 03/05/2014, 08:59 PM   #6
brent94
Big Clucker
 
Join Date: Mar 2014
Location: Canada
Posts: 73
Reputation: 36
Default Re: Problem with OnPlayerTakeDamage

Mind taking a screenshot of the compiler window, with the error, and uploading it for us?
brent94 is offline   Reply With Quote
Old 04/05/2014, 01:41 PM   #7
Syncro
Little Clucker
 
Syncro's Avatar
 
Join Date: Jan 2014
Posts: 32
Reputation: 0
Default Re: Problem with OnPlayerTakeDamage

Ok, look

With OnPlayerTakeDamage and Script:


With OnPlayerTakeDamage but without the internal script!


It running! The warning is mine, i can remove it! Why with the internal script it release many errors?
Syncro is offline   Reply With Quote
Old 04/05/2014, 01:57 PM   #8
[WSF]ThA_Devil
Gangsta
 
[WSF]ThA_Devil's Avatar
 
Join Date: Sep 2010
Location: United Kingdom
Posts: 662
Reputation: 55
Default Re: Problem with OnPlayerTakeDamage

You have ) instead of } for bracket...
after first return 1; in OnPlayerTakeDamage
__________________
Quote:
Originally Posted by Shinobu View Post
Somebody save me, I am not a server.
[WSF]ThA_Devil is offline   Reply With Quote
Old 04/05/2014, 02:59 PM   #9
Galletziz
Huge Clucker
 
Galletziz's Avatar
 
Join Date: Mar 2013
Posts: 275
Reputation: 10
Default Re: Problem with OnPlayerTakeDamage

delete bodypart and it works.. but you can't use this parameter in this callback in future while you don't fix it.
Galletziz is offline   Reply With Quote
Old 04/05/2014, 03:18 PM   #10
Syncro
Little Clucker
 
Syncro's Avatar
 
Join Date: Jan 2014
Posts: 32
Reputation: 0
Default Re: Problem with OnPlayerTakeDamage

Quote:
Originally Posted by [WSF]ThA_Devil View Post
You have ) instead of } for bracket...
after first return 1; in OnPlayerTakeDamage
What? Can you write the correct script for me? I'm italian and I can't speak you! Re-write the script please
Syncro is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnPlayerTakeDamage Problem nor15 Scripting Help 3 17/07/2013 06:23 AM
OnPlayerTakeDamage. budelis Scripting Help 11 27/10/2012 10:35 AM
[HELP]OnPlayerTakeDamage[HELP]!!! Cjgogo Scripting Help 1 19/08/2012 07:35 AM
OnPlayerTakeDamage problem UtkUguR Scripting Help 4 08/03/2012 09:12 PM
Bug OnPlayerTakeDamage Dima_Tkach Scripting Help 2 31/12/2011 11:50 PM


All times are GMT. The time now is 08:07 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.