SA-MP Forums Archive
[Dr.Lozer] Is This Right Code ?? - 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: [Dr.Lozer] Is This Right Code ?? (/showthread.php?tid=386332)



[Dr.Lozer] Is This Right Code ?? - dr.lozer - 20.10.2012

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;
}



Re: [Dr.Lozer] Is This Right Code ?? - newbienoob - 20.10.2012

AntiTeamKill?
Use SetPlayerTeam.


Re: [Dr.Lozer] Is This Right Code ?? - dr.lozer - 20.10.2012

from where can i get that


Re: [Dr.Lozer] Is This Right Code ?? - Simplyfrag - 20.10.2012

make it


Re: [Dr.Lozer] Is This Right Code ?? - mincer - 20.10.2012

https://sampwiki.blast.hk/wiki/SetPlayerTeam


Re: [Dr.Lozer] Is This Right Code ?? - dr.lozer - 20.10.2012

Quote:

make it

Cant you say just " its in a_player.inc"


Re: [Dr.Lozer] Is This Right Code ?? - cessil - 20.10.2012

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