03.11.2013, 23:34
How can you create a Anti Team Kill+where do i need to place it
Please take a look at this function
https://sampwiki.blast.hk/wiki/SetPlayerTeam and here you have a few tutorials and questions already made here where you can find some answers Click me |
public OnPlayerUpdate(playerid)
{
new targetplayer = GetPlayerTargetPlayer(playerid); // Store the ID
if(GetPlayerTeam(targetplayer) == GetPlayerTeam(playerid) && targetplayer != INVALID_PLAYER_ID)
{
GameTextForPlayer(playerid, "~R~do not shoot at team-mates!", 5000, 3);
}
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
new string[128], Float:hp;
GetPlayerHealth(damagedid, hp);
SetPlayerHealth(damagedid, hp+amount);
GameTextForPlayer(playerid, "Don't shoot at team mates!", 3000, 5);
return 1;
}