Raised This Month: $ Target: $400
 0% 

Block T with Ham_Touch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-05-2010 , 07:12   Block T with Ham_Touch
Reply With Quote #1

Hi,

So i wanted to block T's from picking up weapons , this is what ive got ...
Example script :

public fw_TouchWeapon(weapon, id)
{
if ( !is_user_connected(id) )
return HAM_IGNORED;

if ( id && !is_user_bot(id) )
return HAM_SUPERCEDE;

return HAM_IGNORED;
}

well ... it blocks both T's and CTS from picking up weapons since i haven't ignored any teams ... i tried changing stuff like if cs_get_user_team is CT , then ignore , but it still did not work
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%

Last edited by SaM.ThE.MaN; 10-05-2010 at 07:59.
SaM.ThE.MaN is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-05-2010 , 07:22   Re: Block T with Ham_Touch
Reply With Quote #2

Try putting this in ur script:
Code:
public fw_TouchWeapon(weapon, id) {     if ( !is_user_connected(id) )         return HAM_IGNORED;         if ( id && !is_user_bot(id) && cs_get_user_team(id) == CS_TEAM_T)         return HAM_SUPERCEDE;         return HAM_IGNORED; }
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-05-2010 , 08:05   Re: Block T with Ham_Touch
Reply With Quote #3

aww ... thanx man , it works , ... anyways i don't get it , how does this work ... i tried adding the get team thing separately , and it did not work , how come it works now
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-05-2010 , 08:33   Re: Block T with Ham_Touch
Reply With Quote #4

Because, it shouldn't be separate., all conditions must be met to block the function.

I think this is how you did it:
Code:
public fw_TouchWeapon(weapon, id)
{
     if ( !is_user_connected(id) )
         return HAM_IGNORED;

     if ( id && !is_user_bot(id))
         return HAM_SUPERCEDE;

     if (cs_get_user_team(id) == CS_TEAM_T)
         return HAM_SUPERCEDE;

     return HAM_IGNORED;
}
That is wrong, since it will never reach the third if().
__________________

Last edited by Hunter-Digital; 10-05-2010 at 08:38.
Hunter-Digital is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 10-05-2010 , 09:36   Re: Block T with Ham_Touch
Reply With Quote #5

how come i never thought about it ... omg i even 4got the basics -.- grr..
__________________
  • Project : Level Plugin
o [||||||||||] - 100%
  • Project : OnePieceMod
o [||||||||||] - 20%
SaM.ThE.MaN 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 10:20.


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