If player shoots same team, he gets a textdraw warning (which callback do i use) -
Ghost100 - 02.09.2012
Hiya, so i want a textdraw to pop up if a player from team A shoots another player from team A.
Im not sure which callback i should use it for.
Any help is appreciated, thanks
Re: If player shoots same team, he gets a textdraw warning (which callback do i use) -
[HK]Ryder[AN] - 02.09.2012
In the
call back check if the playerid and damageid are of same team..if they are same show textdraw or do nothing.
OR
You can use this custom callback
https://sampforum.blast.hk/showthread.php?pid=937824#pid937824
Re: If player shoots same team, he gets a textdraw warning (which callback do i use) -
SAMPHacker - 02.09.2012
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
return 1;
}
https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
Re: If player shoots same team, he gets a textdraw warning (which callback do i use) -
ZoMDE_KJ - 02.09.2012
warn the guy
Re: If player shoots same team, he gets a textdraw warning (which callback do i use) -
Ghost100 - 02.09.2012
Hiya, i use:
static gTeam[MAX_PLAYERS];
gTeam[playerid] = TEAM_POL;
gTeam[playerid] = TEAM_TER;
Re: If player shoots same team, he gets a textdraw warning (which callback do i use) -
SAMPHacker - 02.09.2012
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(gTeam[playerid] == gTeam[damageid])
{
new Float:Health, Float:Armour;
GetPlayerHealth(damagedid,Health);
GetPlayerArmour(damagedid, Armour);
GameTextForPlayer(playerid,"~r~Team-Kill ~w~is ~r~NOT ~w~Allowed",2000,3); // Show the player message for 2 mins.
if(Armour > 0)
{
SetPlayerArmour(damagedid,Armour+amount); // Restore the lost Armour amount.
}
else
{
SetPlayerHealth(damagedid,Health+amount); // Restore the lost Health amount.
}
}
return 1;
}
Re: If player shoots same team, he gets a textdraw warning (which callback do i use) -
Ghost100 - 06.09.2012
thank you..much appreciated i would rep you if i could xD
Re: If player shoots same team, he gets a textdraw warning (which callback do i use) -
[ABK]Antonio - 06.09.2012
SetPlayerTeam or
OnPlayerTakeDamage instead of give. give = shoot skin, take = dude gets shot on his screen