[Dr.Lozer] Is This Right Code ??
#1

Guyz i made a AntiTeamKill with opsp.inc

Is This Code Is Right Or Wrong ??

Pawn
Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
	new Float:health; GetPlayerHealth(Target, health);
	new Float:armour; GetPlayerArmour(Target, armour);
	if(PlayerInfo[Shooter][Team] == PlayerInfo[Target][Team]) {
	    SetPlayerHealth(Target, health +HealthLost);
	    SetPlayerArmour(Target, armour +ArmourLost);
	}
	return 1;
}
Reply
#2

AntiTeamKill?
Use SetPlayerTeam.
Reply
#3

from where can i get that
Reply
#4

make it
Reply
#5

https://sampwiki.blast.hk/wiki/SetPlayerTeam
Reply
#6

Quote:

make it

Cant you say just " its in a_player.inc"
Reply
#7

if you're using the old script that uses a bunch of math to determine who the shooter was most likely then you're better off using the callback OnPlayerTakeDamage
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)