Using Teams and CustomDamage
#1

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)?
Reply
#2

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;
}
Reply
#3

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
Reply
#4

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 .
Reply
#5

EDIT: Oh nvm i misunderstood.
Reply
#6

I guess ****** could give me a proper answer Thanks though CalvinC
Reply
#7

Simply set civilians to 'No team', AKA 'NO_TEAM' AKA '255'.
pawn Код:
SetPlayerTeam(playerid, NO_TEAM);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)