Raised This Month: $ Target: $400
 0% 

Team Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MspoR
Member
Join Date: Sep 2015
Old 12-25-2015 , 16:58   Team Menu
Reply With Quote #1

Hello, I need help with one little think. I'm really bad at only team view name menu. So I need to make this code to work. If you are T, it will show menu of your team mates. If you are CT, it will show you CT Players.


PHP Code:
public cmd_transfermenu(id)
{
static 
opcion[64]

formatex(opcioncharsmax(opcion),"Choose player")
new 
iMenu menu_create(opcion"cmd_transfermenu_handler")

new 
players[32], pnumtempid
new szName[32], szTempid[10]

{
if(
get_user_team(id) == 2)
{
static 
iPlayers[32], iNumiiPlayer;
get_playersiPlayersiNum"ae""CT" );
tempid players 
get_user_name
(tempidszName31)
num_to_str(tempidszTempid9)

formatex(opcioncharsmax(opcion), "\w%s \y- \r[Points: %d]"szNamejbm_get_user_points(tempid))
menu_additem(iMenuopcionszTempid0)
}

else 
{
static 
iPlayers[32], iNumiiPlayer;
get_playersiPlayersiNum"ae""TERRORIST" ); 

tempid players

get_user_name
(tempidszName31)
num_to_str(tempidszTempid9)

formatex(opcioncharsmax(opcion), "\w%s \y- \r[Points: %d]"szNamejbm_get_user_points(tempid))
menu_additem(iMenuopcionszTempid0)
}

menu_display(idiMenu)

}
return 
PLUGIN_HANDLED



Thank you.

Last edited by MspoR; 12-26-2015 at 02:56.
MspoR is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-25-2015 , 17:58   Re: Team Menu
Reply With Quote #2

Put code between [php] tags
redivcram is offline
MspoR
Member
Join Date: Sep 2015
Old 12-26-2015 , 02:56   Re: Team Menu
Reply With Quote #3

Done and sorry
MspoR is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 12-26-2015 , 10:50   Re: Team Menu
Reply With Quote #4

PHP Code:
public cmd_transfermenu(id

static 
opcion[64

formatex(opcioncharsmax(opcion),"Choose player"
new 
iMenu menu_create(opcion"cmd_transfermenu_handler"

static 
iPlayers[32], iNumitempidteamid 

teamid 
cs_get_user_team(id)
get_playersiPlayersiNum); 

   for(
0i<iNumi++ )
   {
       
tempid iPlayers[i
       if(
cs_get_user_team(tempid) == teamid){ 
            
get_user_name(tempidszName31
            
num_to_str(tempidszTempid9

            
formatex(opcioncharsmax(opcion), "\w%s \y- \r[Points: %d]"szNamejbm_get_user_points(tempid)) 
            
menu_additem(iMenuopcionszTempid0
       }
    }

   
menu_display(idiMenu)  

At the top of the plugin don't forget to add:
#define <cstrike>

Because function cs_get_user_team requires module cstrike to be defined.

Last edited by siriusmd99; 12-26-2015 at 10:54.
siriusmd99 is offline
MspoR
Member
Join Date: Sep 2015
Old 12-26-2015 , 16:54   Re: Team Menu
Reply With Quote #5

Great. Thanks
MspoR 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 17:50.


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