04.10.2014, 17:57
Hey everyone.
I need a bit of help, Here i'm detecting if team_hunter shoots team_prop's (Object) which is Prop[i]. But in-game if hunter shoots the object it dosen't kills prop :/ I have no idea what's wrong
I've also tried this.
I need a bit of help, Here i'm detecting if team_hunter shoots team_prop's (Object) which is Prop[i]. But in-game if hunter shoots the object it dosen't kills prop :/ I have no idea what's wrong
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
foreach(new ii: Player)
if(GetPlayerTeam(ii) == team_hunter)
{
if(hittype == BULLET_HIT_TYPE_PLAYER_OBJECT)
{
foreach(new i:Player)
{
if(GetPlayerTeam(ii) != team_prop) continue;
if(hitid == Prop[i])
{
SetPlayerHealth(i, 0);
SendClientMessage(i, -1, "Test");
break;
}
}
}
}
return 1;
}
I've also tried this.
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch (hittype)
{
case BULLET_HIT_TYPE_PLAYER_OBJECT:
{
foreach(new i:Player)
foreach(new ii: Player)
{
if(GetPlayerTeam(i) == team_hunter) continue;
if(GetPlayerTeam(ii) == team_prop) continue;
if(hitid == Prop[ii])
{
SetPlayerHealth(ii, 0);
SendClientMessage(ii, -1, "You have been killed");
break;
}
}
}
}
return 1;
}