OnPlayerGiveDamage fail?:(
#1

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
Reply
#2

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

Put

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

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

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 ("}")
Reply
#5

Old SAMP version ?
Reply
#6

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?
Reply
#7

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

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
Reply
#8

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.
Reply
#9

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?
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)