AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [REQ] Help Bazooka (https://forums.alliedmods.net/showthread.php?t=244129)

director 07-14-2014 05:10

[REQ] Help Bazooka
 
1 Attachment(s)
First I want to say hello, I have a very small problem with bazooka:
When i buy it and i am CT i can kill with bazooka an enemy and teammate
whats wrong on the code...

mottzi 07-14-2014 13:49

Re: [REQ] Help Bazooka
 
Line 1229: Add

PHP Code:

 && cs_get_user_team(iVictim) != cs_get_user_team(owner

into the if statement to make sure friendlyfire gets blocked

HamletEagle 07-15-2014 06:20

Re: [REQ] Help Bazooka
 
Quote:

Originally Posted by mottzi (Post 2167557)
Line 1229: Add

PHP Code:

 && cs_get_user_team(iVictim) != cs_get_user_team(owner

into the if statement to make sure friendlyfire gets blocked

This could cause some debug errors.Better to do:
Above the if:

PHP Code:

new CsTeamsOwnerTeam cs_get_user_team owner )
new 
CsTeamsVictimTeam cs_get_user_team iVictim 

Into the if:
PHP Code:

&& ( OwnerTeam != VictimTeam 


Flick3rR 07-15-2014 08:55

Re: [REQ] Help Bazooka
 
Won't the natives from amxmodx work the same way with the same results? I mean, without cs_, the original ones. When it's about a compare I prefer them, because the don't cause these errors sometimes.

HamletEagle 07-15-2014 09:33

Re: [REQ] Help Bazooka
 
Quote:

Originally Posted by Flick3rR (Post 2168001)
Won't the natives from amxmodx work the same way with the same results? I mean, without cs_, the original ones. When it's about a compare I prefer them, because the don't cause these errors sometimes.

Amxmodx one is bugged, if you swap teams and don't kill the players it will return the wrong team until a new round start ( a new ScoreInfo and a new TeamInfo message is send ). Anyway Team name based on team info is always correct, only team index is wrong.

Read more here: https://forums.alliedmods.net/showpo...06&postcount=7

I think that some time ago, Amxmodx team try to fix it, but , if I remember good, the bug is still there.

Edit: they do the same thing, but your way will cause errors in server console. Just test it.

mottzi 07-15-2014 10:30

Re: [REQ] Help Bazooka
 
HamletEagle, your code does exactly the same as mine, explain what you mean please.

director 07-16-2014 08:02

Re: [REQ] Help Bazooka
 
I solved it
Code:

if((0 < iVictim < 32) && is_user_alive(iVictim) && iVictim != owner )
with
Code:

if((0 < iVictim < 32) && is_user_alive(iVictim) &&  iVictim != owner && get_user_team(iVictim) == 1)
thx for help


All times are GMT -4. The time now is 21:07.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.