Question + Help - 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: Question + Help (
/showthread.php?tid=635946)
Question + Help -
StR_MaRy - 16.06.2017
Hey guys can someone help me and say why or solve it for me ? is not a big problem .. but i really don't know why is not working :-s
under public onplayergivedamage
HTML Code:
new sameteam = HumanPlayer[playerid] == 1;
new sameteamd = HumanPlayer[damagedid] == 1;
Type 1: if(HumanPlayer[playerid] == 1 && HumanPlayer[damagedid] == 1) amount = 0;
Type 2: if(HumanPlayer[playerid] == 1 && HumanPlayer[damagedid] == 1 && sameteam == sameteamd) amount = 0;
nothing from type 1 and 2 is working... when i shot a team mate he still get's damage , can someone help me ?
Re: Question + Help -
Vince - 16.06.2017
Why don't you just use SetPlayerTeam?
Re: Question + Help -
StR_MaRy - 16.06.2017
Quote:
Originally Posted by Vince
Why don't you just use SetPlayerTeam?
|
can you give me a model ... or a solve

i still didn't find something
Re: Question + Help -
CheezIt - 16.06.2017
Try setting both players' team to human, have you tried that? lol
If you have verified that they are called however, then the issue is obviously somewhere else. Also, you cannot stop damage by returning 0 in OPGD, so if you don't have a custom damage system this is pointless. If you're restoring health in OPGD then you should be doing that under OPTD instead.
Re: Question + Help -
StR_MaRy - 16.06.2017
Quote:
Originally Posted by CheezIt
Try setting both players' team to human, have you tried that? lol
|
HumanPlayer is it if you watch closer
HumanPlayer[playerid] == 1 // is the attacker
HumanPlayer[damagedid] == 1 // is the person who took damage from his team mate
and that will call
sameteam == sameteamd
Re: Question + Help -
CheezIt - 16.06.2017
Quote:
Originally Posted by StR_MaRy
HumanPlayer is it if you watch closer
HumanPlayer[playerid] == 1 // is the attacker
HumanPlayer[damagedid] == 1 // is the person who took damage from his team mate
and that will call
sameteam == sameteamd
|
You think I'm that stupid? This is practically the exact same thing: if(HumanPlayer[playerid] == 1 && HumanPlayer[damagedid] == 1)
You're saying it's not working, so it's safe to assume that your conditions are not being called at all, thus causing your system to not work. And like I said above, if it is called then you obviously got something wrong beyond those two if-then's (the second if-then is basically the same thing as the first one but doing the same validation twice...).
Re: Question + Help -
StR_MaRy - 16.06.2017
EDIT: SOLVED
Re: Question + Help -
CheezIt - 16.06.2017
Those two if-then's aren't even in your callback lol
I'm done wasting my time with you, good luck.