#1

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

Why ?
Change killerid by damagedid
Reply
#3

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

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;

Reply
#5

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 !
Reply
#6

No problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)