Raised This Month: $ Target: $400
 0% 

Hamsandwich Forward, Return values


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 06-14-2010 , 14:35   Re: Hamsandwich Forward, Return values
Reply With Quote #1

Anyway, to filter valid player you can also use
Code:
     is_user_alive(id)


Code:
public fwButtonUsed(idcaller) 
{    
    if ( !is_user_alive ( idcaller ) )           
        return HAM_IGNORED
    
    static CsTeams:iTeam
    iTeam = cs_get_user_team ( idcaller )   
    
    if ( IsFreeRun && iTeam == CS_TEAM_T )           
        return HAM_SUPERCEDE
    
    return HAM_IGNORED
}

__________________


Last edited by NiHiLaNTh; 06-14-2010 at 14:56. Reason: O.o I didn't read carefully Alucard's post!
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-14-2010 , 14:54   Re: Hamsandwich Forward, Return values
Reply With Quote #2

Quote:
Originally Posted by NiHiLaNTh View Post

Actually it should be
Code:
#define IsPlayer(%1) ( 1 <= %1 <= 32 )
Anyway, to filter valid player you can also use
Code:
     is_user_alive(id)


Code:
public fwButtonUsed(idcaller) 
{    
    if ( !is_user_alive ( idcaller ) )           
        return HAM_IGNORED
    
    static CsTeams:iTeam
    iTeam = cs_get_user_team ( idcaller )   
    
    if ( IsFreeRun && iTeam == CS_TEAM_T )           
        return HAM_SUPERCEDE
    
    return HAM_IGNORED
}

1. Lol, what is the difference? o.O

My code = 1 to 32, your code = 1 to 32... is the same thing with differents operators...

2. Yeah, i thinked about that check, but i didn't sure about that...

@ t3hNox

mMm, strange, should work, i think...

Test this:

Code:
public fwButtonUsed(idcaller) {         if (IsFreeRun && cs_get_user_team(idCaller) == CS_TEAM_T && is_user_alive(idCaller) )                   return HAM_SUPERCEDE;         return HAM_IGNORED; }

But is practicaly the same thing...
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 14:56.


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