Raised This Month: $ Target: $400
 0% 

Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-24-2013 , 12:19   Menu
Reply With Quote #1

When i Choose 0 it only starts 0.
But when i start 1 it starts 0 and 1
Why?

Code:
Code:
public TeamMenu( id )
{ 
 new szText[ 555 char ]
 formatex( szText, charsmax( szText ), "Team Menu")
 new menu = menu_create( szText, "TeamMenu_Handler" )
 
 menu_additem( menu, "\rT VS T", "0", 0 )
 
 menu_additem( menu, "\rCT VS T", "1", 0 )
 
 menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
 menu_display( id, menu, 0 )
}
public TeamMenu_Handler( id, menu, item )
{
 if( item == MENU_EXIT )
 {
  menu_destroy( menu )
  return PLUGIN_HANDLED
 }
 new data[ 6 ], iName[ 64 ], access, callback
 menu_item_getinfo( menu, item, access, data, charsmax( data ), iName, charsmax( iName ), callback )
 
 Team = str_to_num( data ) 
 
 set_task( 0.1,"StartGames", Team );
 
 return PLUGIN_HANDLED
}
public StartGames( )
{
 if( 1 <= Team ) 
 { 
  ColorChat(id, GREY, "Started 1", Team)
 }
 
 if( 0 <= Team ) 
 { 
  ColorChat(id, GREY, "Started 0", Team)
 }
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Old 05-24-2013, 17:19
akcaliberg
This message has been deleted by akcaliberg.
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 05-24-2013 , 17:21   Re: Menu
Reply With Quote #3

Did you try to compile your code ? First fix the errors
akcaliberg is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-25-2013 , 05:32   Re: Menu
Reply With Quote #4

Quote:
Originally Posted by akcaliberg View Post
Did you try to compile your code ? First fix the errors
There are no errors..
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Decompiler
>:)
Join Date: Mar 2013
Old 05-25-2013 , 06:58   Re: Menu
Reply With Quote #5

Maybe because of this:

Quote:
if( 1 <= Team )
.

Remove the < sign and see if that helps.
Decompiler is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-27-2013 , 13:57   Re: Menu
Reply With Quote #6

Quote:
Originally Posted by Decompiler View Post
Maybe because of this:

.

Remove the < sign and see if that helps.
i dont think that will help at all..
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 05-27-2013 , 15:47   Re: Menu
Reply With Quote #7

PHP Code:
public TeamMenuid )
{
    new 
menu menu_create("Team Menu""TeamMenu_Handler" )
 
    
menu_additemmenu"\rT VS T""0")
 
    
menu_additemmenu"\rCT VS T""1")
 
    
menu_setpropmenuMPROP_EXITMEXIT_ALL )
    
menu_displayidmenu)
}

public 
TeamMenu_Handleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu )
         return 
1
    
}
 
    
ColorChat(idGREY"Started %i",item)
    

    
menu_destroymenu )
     return 
1

__________________
simanovich is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-28-2013 , 12:21   Re: Menu
Reply With Quote #8

that was not what i asked for
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-28-2013 , 13:52   Re: Menu
Reply With Quote #9

You are giving your task an ID but your function header doesn't have one
__________________
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
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 06-02-2013 , 10:40   Re: Menu
Reply With Quote #10

Still problems

T vs T works it only shows T vs T hud message

but when i start CT vs T it shows CT vs T and T vs T hud message


Code:
PHP Code:
ublic TeamMenuid )

 new 
szText555 char ]
 
formatexszTextcharsmaxszText ), "\r%s\w by %s^n\y-Choose Team"PREFIXAUTHOR )
 new 
menu menu_createszText"TeamMenu_Handler" )
 
 
menu_additemmenu"\rT VS T""0")
 
 
menu_additemmenu"\rCT VS T""1")
 
 
menu_setpropmenuMPROP_EXITMEXIT_ALL )
 
menu_displayidmenu)
}
public 
TeamMenu_Handleridmenuitem )
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroymenu )
  return 
PLUGIN_HANDLED
 
}
 new 
data], iName64 ], accesscallback
 menu_item_getinfo
menuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback )
 
 new 
Team str_to_numdata 
 
 
set_task0.1,"StartGames"Team );
 
 return 
PLUGIN_HANDLED
}
public 
StartGamesTeam )

 static 
players32 ], numid;
 
get_playersplayersnum"a" );
 
 for( new 
0numi++ )
 {
  
id players];
  
  if( 
<= Team 
  {   
   
show_dhudmessage0"[CT VS T] Started" )
   
set_dhudmessage25500, -1.00.0201.07.00.11.0 
  }
  if( 
<= Team 
  { 
   
show_dhudmessage0"[T VS T] Started" )
   
set_dhudmessage25500, -1.00.0201.07.00.11.0 
  }   
 }

__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 06-02-2013 at 10:41.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
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 16:27.


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