SA-MP Forums Archive
Help - 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 (/showthread.php?tid=572712)



Help - BlackEvils - 01.05.2015

Hi all,

Im trying to build an anti teamkill system,

public OnPlayerGiveDamage(playerid, killerid, Float: amount, weaponid, bodypart)
{
if(PlayerInfo[killerid][gangid] == PlayerInfo[playerid][gangid])
{
SendClientMessage(playerid,COLORE_ROSSO, "Anti Teamkill:Stop shoot your gang members!");
}
return 1;
}

I have add killerid => https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage ,and i got this "error error 025: function heading differs from prototype", how i can resove it? without remove "killerid"?


Re : Help - StreetRP - 01.05.2015

Why ?
Change killerid by damagedid


Re: Re : Help - BlackEvils - 01.05.2015

Quote:
Originally Posted by StreetRP
Посмотреть сообщение
Why ?
Change killerid by damagedid
I must add it because i must check if the killerid is shooting to the playerid and in what gang they are
if(PlayerInfo[killerid][gangid] == PlayerInfo[playerid][gangid]) so i must i add killerid


Re : Help - StreetRP - 01.05.2015

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)

Playerid = The ID of the player that gave damage.

Damageid= The ID of the player that received damage.

So :

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
if(
PlayerInfo[damagedid][gangid] == PlayerInfo[playerid][gangid])
{
SendClientMessage(playerid,COLORE_ROSSO"Anti Teamkill:Stop shoot your gang members!");
}
return 
1;




Re: Re : Help - BlackEvils - 01.05.2015

Quote:
Originally Posted by StreetRP
Посмотреть сообщение
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)

Playerid = The ID of the player that gave damage.

Damageid= The ID of the player that received damage.

So :

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponidbodypart)
{
if(
PlayerInfo[damagedid][gangid] == PlayerInfo[playerid][gangid])
{
SendClientMessage(playerid,COLORE_ROSSO"Anti Teamkill:Stop shoot your gang members!");
}
return 
1;

thx you !


Re : Help - StreetRP - 01.05.2015

No problem