Raised This Month: $ Target: $400
 0% 

Commands for Ts are executed on CTs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-07-2011 , 10:45   Commands for Ts are executed on CTs
Reply With Quote #1

Hello everybody,
I've got a problem with my menu, everything which should happen on the Ts happens on the CTs, I hope you can search the mistake and tell me whats wrong. :

PHP Code:
public submenuverstecken_handler(idmenuitem)
{
    
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
    }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    
    new 
key str_to_num(data)
    
    switch(
key)
    {
        case 
1:
        {
            for (new 
user 1user <= gMaxPlayersuser++)
            {
                new 
CsTeams:Team;
                
Team cs_get_user_team(user);
                
                if (
Team == CS_TEAM_T)
                {
                    
set_user_maxspeed(id0)
                }
            }
        }
        case 
2:
        {
            for (new 
user 1user <= gMaxPlayersuser++)
            {
                new 
CsTeams:Team;
                
Team cs_get_user_team(user);
                
                if (
Team == CS_TEAM_T)
                {
                    
set_user_maxspeed(id,320)
                }
            }
        }
    }
    return 
PLUGIN_HANDLED;

Kia is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 04-07-2011 , 11:08   Re: Commands for Ts are executed on CTs
Reply With Quote #2

umm
try writing ct instead of t and see what happens?
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-07-2011 , 11:17   Re: Commands for Ts are executed on CTs
Reply With Quote #3

No changes...

// EDIT :

After using CT instead of T and then changing back to T, it worked. ö.o

Last edited by Kia; 04-07-2011 at 11:24.
Kia is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 04-07-2011 , 22:15   Re: Commands for Ts are executed on CTs
Reply With Quote #4

Well, firstly, use is_user_connected() or is_user_alive(), otherwise it'll error on the first non-existent id.

Also, since you're checking the team of all 'user's, set_user_maxspeed(id,320) should be set_user_maxspeed(user,320)?
Elusive138 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-08-2011 , 00:53   Re: Commands for Ts are executed on CTs
Reply With Quote #5

Lol, you loop though all players, and each time a single player match the team you check, you execute the code on the first player passed (id).

You don't understand what you do, you should start with more basic and easy code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-08-2011 , 16:46   Re: Commands for Ts are executed on CTs
Reply With Quote #6

Hmm...what code should I use instead?

EDIT :

Ok, got it.
PHP Code:
new CsTeams:team cs_get_user_team(id)
    if (
team == CS_TEAM_T)
    {
            
set_user_health(id1)
    } 

Last edited by Kia; 04-08-2011 at 16:50.
Kia is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-09-2011 , 09:02   Re: Commands for Ts are executed on CTs
Reply With Quote #7

mh, doesnt work, dont know, anyone know the right code?
Kia 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 19:48.


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