Using Teams and CustomDamage - 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: Using Teams and CustomDamage (
/showthread.php?tid=562981)
Using Teams and CustomDamage -
vassilis - 13.02.2015
Hey guys.
I had an idea and i would like to have some answers .
Since 0.3c(if i am not wrong)if you use SetPlayerTeam you avoid Team killing. If i use Custom damage would player lose health even if they are in the same team(Making CNR script i want it for Civilians)?
Re: Using Teams and CustomDamage -
CalvinC - 13.02.2015
Im not sure, but if it does, you should be able to avoid it by doing this:
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(hitid) return 0;
return 1;
}
Re: Using Teams and CustomDamage -
vassilis - 13.02.2015
Quote:
Originally Posted by CalvinC
Im not sure, but if it does, you should be able to avoid it by doing this:
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { if(GetPlayerTeam(playerid) == GetPlayerTeam(hitid) return 0; return 1; }
|
The point is that i don't want to avoid it for civilians. I want it so civilians could lost hp
Re: Using Teams and CustomDamage -
vassilis - 13.02.2015
Quote:
Originally Posted by ******
SetPlayerHealth still works, if that's what you mean.
|
I am using SetPlayerTeam for teams in my cops n robbers Gamemode. Obviously civilians will have to kill each other. However due to using SetPlayerTeam function civilians can't cause damage to each other. Is there a way i could use so civilians can cause damage to each other?
Is SetPlayerHealth the right function for this?(I guess i will use it OnPlayerGiveDamage callback?)
P.S: Sorry for not speaking proper English .
Re: Using Teams and CustomDamage -
CalvinC - 13.02.2015
EDIT: Oh nvm i misunderstood.
Re: Using Teams and CustomDamage -
vassilis - 13.02.2015
I guess ****** could give me a proper answer

Thanks though CalvinC
Re: Using Teams and CustomDamage -
Threshold - 13.02.2015
Simply set civilians to 'No team', AKA 'NO_TEAM' AKA '255'.
pawn Код:
SetPlayerTeam(playerid, NO_TEAM);