Raised This Month: $ Target: $400
 0% 

[REQ] Help Bazooka


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
director
Junior Member
Join Date: Sep 2012
Old 07-14-2014 , 05:10   [REQ] Help Bazooka
Reply With Quote #1

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...
Attached Files
File Type: sma Get Plugin or Get Source (furien_shop.sma - 547 views - 43.9 KB)
director is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-14-2014 , 13:49   Re: [REQ] Help Bazooka
Reply With Quote #2

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

Last edited by mottzi; 07-14-2014 at 13:49.
mottzi is offline
Send a message via MSN to mottzi
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-15-2014 , 06:20   Re: [REQ] Help Bazooka
Reply With Quote #3

Quote:
Originally Posted by mottzi View Post
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 
HamletEagle is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-15-2014 , 08:55   Re: [REQ] Help Bazooka
Reply With Quote #4

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.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-15-2014 , 09:33   Re: [REQ] Help Bazooka
Reply With Quote #5

Quote:
Originally Posted by Flick3rR View Post
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.

Last edited by HamletEagle; 07-16-2014 at 08:04.
HamletEagle is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-15-2014 , 10:30   Re: [REQ] Help Bazooka
Reply With Quote #6

HamletEagle, your code does exactly the same as mine, explain what you mean please.
mottzi is offline
Send a message via MSN to mottzi
director
Junior Member
Join Date: Sep 2012
Old 07-16-2014 , 08:02   Re: [REQ] Help Bazooka
Reply With Quote #7

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

Last edited by director; 07-16-2014 at 08:03.
director is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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