OnPlayerTakeDamage Problem - 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: OnPlayerTakeDamage Problem (
/showthread.php?tid=451421)
OnPlayerTakeDamage Problem -
nor15 - 17.07.2013
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
new string[128];
if(gTeam[issuerid] == TEAM_COP || gTeam[issuerid] == TEAM_ARMY || gTeam[issuerid] == TEAM_CIA || gTeam[issuerid] == TEAM_SWAT)
{
if(gTeam[playerid] != TEAM_COP || gTeam[playerid] != TEAM_ARMY || gTeam[playerid] != TEAM_CIA || gTeam[playerid] != TEAM_SWAT)
{
if(weaponid == 23)
{
format(string,sizeof(string),"Police officer %s(%d) has tazed %s(%d).",PlayerName(issuerid),issuerid,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_DODGERBLUE,string);
GameTextForPlayer(playerid, "~b~TAZED~n~~w~FOR ~y~3~w~SECONDS", 3000, 5);
TogglePlayerControllable(playerid,0);
IsTazed[playerid] =3;
}
}
}
return 1;
}
The problem is that when i shoot TEAM_COP , they also got tazed
Re: OnPlayerTakeDamage Problem -
xganyx - 17.07.2013
You mean when you shoot other player but in your team you will be freeze?
Re: OnPlayerTakeDamage Problem -
nor15 - 17.07.2013
No, I made this if(gTeam[playerid] != TEAM_COP || gTeam[playerid] != TEAM_ARMY || gTeam[playerid] != TEAM_CIA || gTeam[playerid] != TEAM_SWAT)
So another Cops can't be tazed , but they got tazed
Re: OnPlayerTakeDamage Problem -
xganyx - 17.07.2013
here :
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
new string[128];
if(gTeam[playerid] != TEAM_COP || gTeam[playerid] != TEAM_ARMY || gTeam[playerid] != TEAM_CIA || gTeam[playerid] != TEAM_SWAT)
{
if(weaponid == 23)
{
format(string,sizeof(string),"Police officer %s(%d) has tazed %s(%d).",PlayerName(issuerid),issuerid,PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_DODGERBLUE,string);
GameTextForPlayer(playerid, "~b~TAZED~n~~w~FOR ~y~3~w~SECONDS", 3000, 5);
TogglePlayerControllable(playerid,0);
IsTazed[playerid] =3;
}
}
return 1;
}