Hamsandwich Forward, Return values
Hi.
I've never worked with hamsandwich module before. Basically I'm making a plugin that would block Ts from clicking any button if IsFreeRun is "true", however, CTs would be still able to use them (no matter the IsFreeRun value). The code is mainly taken from another plugin - Use Button Once. PHP Code:
Currently I'm not really interested in any optimizations (if any is possible), I just need to get the code to work. |
Re: Hamsandwich Forward, Return values
This is useless, i think:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: Hamsandwich Forward, Return values
Unfortunately, no success.
The function now looks like this: PHP Code:
Server's console returns this error (although, the plugin completes fine) : Code:
L 06/14/2010 - 20:22:17: [AMXX] [0] sample.sma::fwButtonUsed (line 79)PHP Code:
|
Re: Hamsandwich Forward, Return values
mMM, strange =S... no, you are using cs_get_user_team( ) correctly.
I think is not a problem of that part of code, is another thing, don't know. EDIT: I never tried with IamBool == true in a condition... i think is ok but don't sure... i usually use if(IamBool) or if(!IamBool), just try... who know. EDIT2: what version of AMXX you are using? maybe cstrike module is outdate. |
Re: Hamsandwich Forward, Return values
check if the caller is a player.
|
Re: Hamsandwich Forward, Return values
Here's how it looks. I know, probably poorly coded.
*No more available. Optimizing and upgrading it.* The AMXX version I'm using is 1.8.1. |
Re: Hamsandwich Forward, Return values
Quote:
Code:
Also... rememebr that: Code:
Is useless... |
Re: Hamsandwich Forward, Return values
Huh, I'm not sure how to check if a caller is a player ( if(idcalled) ?). And I'm also not sure how to use that define. I tried this:
Code:
if(IsFreeRun == true && IsPlayer(idcaller))Another interesting this is that the "check" function (see the full code) cannot properly detect the player's team at the beginning of a round. |
Re: Hamsandwich Forward, Return values
Anyway, to filter valid player you can also use
Code:
is_user_alive(id)Code:
public fwButtonUsed(idcaller) |
Re: Hamsandwich Forward, Return values
Unfortunately, no success. With this version everyone can click buttons.
PHP Code:
|
| All times are GMT -4. The time now is 14:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.