SA-MP Forums Archive
OnPlayerGiveDamage fail?:( - 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: OnPlayerGiveDamage fail?:( (/showthread.php?tid=455763)



OnPlayerGiveDamage fail?:( - Saize - 03.08.2013

yo, this is my problem

Quote:

PG.pwn(911) : warning 235: public function lacks forward declaration (symbol "OnPlayerGiveDamage")

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponid)
{
    
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    return 
1;

Line 911:

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponid



Re: OnPlayerGiveDamage fail?:( - cosbraa - 03.08.2013

Above the line with public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)

Put

forward OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);


Re: OnPlayerGiveDamage fail?:( - JusstinRoller - 03.08.2013

PHP код:
forward OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponid); 



AW: OnPlayerGiveDamage fail?:( - Saize - 03.08.2013

It dotn works:

C:\Spiele\Server\gamemodes\PG.pwn(912) : error 055: start of function body without function header
C:\Spiele\Server\gamemodes\PG.pwn(914) : error 010: invalid function or declaration
C:\Spiele\Server\gamemodes\PG.pwn(916) : error 054: unmatched closing brace ("}")


Re: OnPlayerGiveDamage fail?:( - Pottus - 03.08.2013

Old SAMP version ?


Re: OnPlayerGiveDamage fail?:( - Ayumi - 03.08.2013

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0); // Ding Sound
    return true;
}
Replace what you have now with that.

See if it compiles?


Re: OnPlayerGiveDamage fail?:( - Edix - 03.08.2013

I suggest you to use OnPlayerTakeDamage as GiveDamage doesnt work quite well because of the lag.

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage


Re: OnPlayerGiveDamage fail?:( - Ayumi - 03.08.2013

Quote:
Originally Posted by Edix
Посмотреть сообщение
I suggest you to use OnPlayerTakeDamage as GiveDamage doesnt work quite well because of the lag.

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
The aim here is to play a "ding" sound when a player hits another player client-side. It's a little feature some servers have for a little bit of humor now and again.


Re: OnPlayerGiveDamage fail?:( - Konstantinos - 03.08.2013

Quote:
Originally Posted by Edix
Посмотреть сообщение
I suggest you to use OnPlayerTakeDamage as GiveDamage doesnt work quite well because of the lag.

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
True. However, OnPlayerGiveDamage is not forwarded to his mode so OnPlayerTakeDamage will not be either.

Quote:

This callback was added in SA-MP 0.3d and will not work in earlier versions!

Don't tell me you're using a_samp.inc from 0.3c?


AW: Re: OnPlayerGiveDamage fail?:( - Saize - 04.08.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
True. However, OnPlayerGiveDamage is not forwarded to his mode so OnPlayerTakeDamage will not be either.



Don't tell me you're using a_samp.inc from 0.3c?
No I dont use it lmao.
I use OnPlayerTakeDamage now with issuerid and it still dosnґt work