Raised This Month: $ Target: $400
 0% 

CountDown Only for CT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 07-29-2013 , 11:32   CountDown Only for CT
Reply With Quote #1

Alright i have a countdown menu which should only be for players in CT which is alive..

PHP Code:
if (is_user_alive(id) && cs_get_user_team(id) & CS_TEAM_CT
But i don't get it why it doesn't work.
It works for everyone and even dead people.


PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "Count down"
#define VERSION "1.1"
#define AUTHOR "UnKnown"
#define CS_TEAM_CT    3  
#define TASKID 1996

new Timer

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /cd""CmdMenu")
    
register_clcmd("say /tid""CmdMenu")
}

public 
CmdMenu(id)
{
    if (
is_user_alive(id) && cs_get_user_team(id) & CS_TEAM_CT)  
    {
    new 
menu menu_create("\rCountdown Menu!""MainMenuHandler"0)
    
    
menu_additem(menu"Timer \d#5""1")
    
menu_additem(menu"Timer \d#10""2")
    
menu_additem(menu"Timer \d#15""3")
    
menu_additem(menu"Timer \d#60""4")
    
menu_additem(menu"Timer \d#120""5")
    
menu_additem(menu"Timer \d#200""6")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
    }
}

public 
MainMenuHandler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], name[64], accescallback
    menu_item_getinfo
(menuitemaccesdatacharsmax(data), namecharsmax(name), callback)
    new 
key str_to_num(data)
    
    switch (
key)
    {
        case 
1Timer 5
            
case 2Timer 10
            
case 3Timer 15
            
case 4Timer 60
       
case 5Timer 120
       
case 6Timer 200
       
        
}
    
Countdown(id)
    return 
PLUGIN_HANDLED
}

public 
Countdown(id)
{
    if(
task_exists(TASKID))
        
remove_task(TASKID)

    
set_task(1.0"Countdown2"TASKID__"a"Timer)
}

public 
Countdown2(id
{
    if (
Timer == 1
    {
        
set_hudmessage(02550, -1.00.4001.01.00.11.02)
        
show_hudmessage(0"Time is up!"
    }
    else 
    {
        
set_hudmessage(02550, -1.00.3001.01.00.11.01)
        
show_hudmessage(0"Timer: %i"Timer--)
    }
    return 
PLUGIN_CONTINUE


Last edited by MrKiller2010; 07-29-2013 at 11:32.
MrKiller2010 is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 07-29-2013 , 11:58   Re: CountDown Only for CT
Reply With Quote #2

PHP Code:
cs_get_user_team(id) == CS_TEAM_CT 
guipatinador is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 07-29-2013 , 13:11   Re: CountDown Only for CT
Reply With Quote #3

Quote:
Originally Posted by guipatinador View Post
PHP Code:
cs_get_user_team(id) == CS_TEAM_CT 
Now /cd doesn't works for anyone.

Have i done anything wrong?

PHP Code:
public CmdMenu(id)
{
    if(
is_user_alive(id) && (cs_get_user_team(id) == CS_TEAM_CT))
    
   {    
    new 
menu menu_create("\rCountdown Menu!""MainMenuHandler"0)
    
    
menu_additem(menu"Timer \d#5""1")
    
menu_additem(menu"Timer \d#10""2")
    
menu_additem(menu"Timer \d#15""3")
    
menu_additem(menu"Timer \d#60""4")
    
menu_additem(menu"Timer \d#120""5")
    
menu_additem(menu"Timer \d#200""6")
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
    }
    else
    {
        
ColorChat(idGREY"^03[SWE-KUNG]^01 Only^03 Alive CTs^01 can open this menu.")
    }


Last edited by MrKiller2010; 07-29-2013 at 13:20.
MrKiller2010 is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 07-29-2013 , 13:34   Re: CountDown Only for CT
Reply With Quote #4

Code:
if( is_user_alive ( id ) && cs_get_user_team( id ) == CS_TEAM_CT )
EpicMonkey is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 07-29-2013 , 13:40   Re: CountDown Only for CT
Reply With Quote #5

Quote:
Originally Posted by EpicMonkey View Post
Code:
if( is_user_alive ( id ) && cs_get_user_team( id ) == CS_TEAM_CT )
Now i get the colorchat messages but when it wont open for CTs..
MrKiller2010 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-29-2013 , 13:54   Re: CountDown Only for CT
Reply With Quote #6

Delete
PHP Code:
#define CS_TEAM_CT    3 
It's not needed, plus it's wrong.

0 = Unassigned
1 = Terrorist
2 = Counter Terrorist
3 = Spectator
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
r3p
BANNED
Join Date: Jul 2013
Old 07-30-2013 , 03:32   Re: CountDown Only for CT
Reply With Quote #7

if(get_user_team(id) = 1) // tero 2-ct 3-spec !

Last edited by r3p; 07-30-2013 at 03:32.
r3p is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2013 , 03:48   Re: CountDown Only for CT
Reply With Quote #8

Quote:
Originally Posted by r3p View Post
if(get_user_team(id) = 1) // tero 2-ct 3-spec !
Please learn before trying to help, you assign instead of checking.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
MrKiller2010
Senior Member
Join Date: Aug 2012
Old 07-30-2013 , 03:54   Re: CountDown Only for CT
Reply With Quote #9

Thanks but i have fixed it!
THanks for the help.
Also i hope you check my other threads! I need help.
MrKiller2010 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 15:51.


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