Raised This Month: $ Target: $400
 0% 

Something wrong. Doesn't print message.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-20-2013 , 17:07   Something wrong. Doesn't print message.
Reply With Quote #1

So, as I have promised I am remaking Dunn0's VIP plugin and I am doing quite well with whole Allied Modders community. But I have few problems. This code doesn't print the message...
PHP Code:
public cmdvipmenu(id
{
    if ( 
is_user_alive(id) )
    {
        if (
get_user_flags(id) & ADMIN_LEVEL_H)
        {
            if ( 
gMenuUsed[id] == menu_uses )
            {
                
client_printidprint_center"%L"id"VIP_MENU_PER_ROUND"menu_uses );
            }
        }
    }
    return 
PLUGIN_HANDLED;

P.S. It's only a part from cmdvipmenu, that doesn't work, everything else does.

Last edited by Unkolix; 02-20-2013 at 17:10.
Unkolix is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-20-2013 , 17:10   Re: Something wrong. Doesn't print message.
Reply With Quote #2

Then one of the if statements is returning false
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-20-2013 , 17:20   Re: Something wrong. Doesn't print message.
Reply With Quote #3

Here, it's the whole cmdvipmenu, don't know what's wrong :/
PHP Code:
public cmdvipmenu(id
{
    if ( 
is_user_alive(id) )
    {
        if (
get_user_flags(id) & ADMIN_LEVEL_H//Checks if player has flag H
        
{
            if ( 
CurrentRound menu_round )
            {
                
client_printidprint_center"%L"id"VIP_MENU_ROUND" ); //Sends a message that VIP can use VIP menu only from specific round
            
}
            if ( 
map_active == //Checks if map_active is 1
            
{
                if( 
g_bCurrentMapIsInList //Checks if current map is in mapnames list
                
{
                    
client_printidprint_center"%L"id"VIP_MENU_WRONG_MAP" ); //Sends a message that VIP can't use VIP menu on that map
                
}
            }
            if ( 
gMenuUsed[id] == menu_uses )
            {
                
client_printidprint_center"%L"id"VIP_MENU_PER_ROUND"menu_uses ); //Message that VIP can only take VIP menu few time that is set as VIPUsed
            
}
            if ( !
g_freezetime && is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H //Checks if freezetime is not over yet and if user is alive and he has flag H
            
{
                
client_printidprint_center"%L"id"VIP_MENU_ONLY_FROM_ROUND_START" ); //Message that's set in vipplugin.txt as VIP_MENU_ONLY_FROM_ROUND_START
            
}
            if(
g_freezetime//Checks if freezetime is over
            
{
                if ( 
gMenuUsed[id] <= menu_uses //Checks if VIP has already used VIP menu before, the amount of times we set as VIPUsed 
                
{
                    if( 
CurrentRound >= menu_round //Checks if current round is more or equal to the round that is set as VIPMenuRound
                    
{    
                        if (!
get_pcvar_num(g_menu_active)) //Checks if g_menu_active is disactivated (set to 0)
                            
return PLUGIN_CONTINUE //If so, VIP won't get VIP menu
                        
Showrod(id//Shows VIP menu
                    
}
                }
            }
        }
        if (!(
get_user_flags(id) & ADMIN_LEVEL_H)) //Checks if user doesn't has flag H
        
{
            
set_task(0.1"PrintText" ,id//Sets a task in 0.1 seconds and starts PrintTect
        
}
    }
    if ( !
is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H //Checks if user is death and he has admin flag H
    
{
        
client_printidprint_center"%L"id"VIP_MENU_MUST_BE_ALIVE" ); //Sends a message that VIP must be alive to use VIP menu
    
}
    if (!
is_user_alive(id) && !(get_user_flags(id) & ADMIN_LEVEL_H)) //Checks if user doesn't has flag H
    
{
        
set_task(0.1"PrintText" ,id//Sets a task in 0.1 seconds and starts PrintTect
    
}
    return 
PLUGIN_HANDLED;

Unkolix is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-20-2013 , 17:26   Re: Something wrong. Doesn't print message.
Reply With Quote #4

You're going to rewrite Dunn0's VIP plugin?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-20-2013 , 17:30   Re: Something wrong. Doesn't print message.
Reply With Quote #5

*sigh* still doesn't work when server is restarted, on the first round.

Last edited by Unkolix; 02-20-2013 at 17:55.
Unkolix is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-20-2013 , 20:51   Re: Something wrong. Doesn't print message.
Reply With Quote #6

Find out what condition is false that shouldn't be. Also, there is no reason to use a task for 0.1 seconds there. Just call the function directly.
__________________

Last edited by fysiks; 02-20-2013 at 20:52.
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-21-2013 , 01:08   Re: Something wrong. Doesn't print message.
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
Then one of the if statements is returning false
or cmdvipmenu is never called.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 02-21-2013 , 03:09   Re: Something wrong. Doesn't print message.
Reply With Quote #8

But everything else works... I believe that something is wrong whit menu_uses cvar... Can't find anything wrong.

EDIT: I fixed it, don't know how

P.S. ConnorMcLeod, I sent you a private message about your strip weapons stock, I don't understand how to make it work. Please send me your answer via private message, or here. It is my last problem with the plugin. Thanks.

Last edited by Unkolix; 02-21-2013 at 08:13.
Unkolix 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:43.


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