AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Menu question (https://forums.alliedmods.net/showthread.php?t=307387)

iceeedr 05-07-2018 16:56

Menu question
 
How can I show the menu only to the opposing team?

PHP Code:

if(SurrenderTr >= 3)
    
g_SurrenderTr true
else if(SurrenderCt >= 3}
    
g_SurrenderCt true 

in the example above, when the team reaches the limit defined by the var, it should open a menu for the opposing team to decide whether to accept the surrender, however I have no idea how to control this menu.

Relaxing 05-07-2018 17:44

Re: Menu question
 
Code:
stock call_menu(iVariable, iVariable2, iNum, CsTeams:LeEquipe, CsTeams:LeEquipe2){      if ((iVariable >= iNum)          && (cs_get_user_team(id) == LeEquipe)){              load_menu(id);              return 1;         }     else if ((iVariable2 >= iNum)          && (cs_get_user_team(id) == LeEquipe2)){              load_menu(id);              return 1;         } } public clcmd_menu(id)     call_menu(CTVotes, TVotes, 3, CS_TEAM_T, CS_TEAM_CT);
There's better ways but this is the first thing that came in mind.

iceeedr 05-07-2018 19:11

Re: Menu question
 
Quote:

Originally Posted by Relaxing (Post 2591192)
Code:
stock call_menu(iVariable, iVariable2, iNum, CsTeams:LeEquipe, CsTeams:LeEquipe2){      if ((iVariable >= iNum)          && (cs_get_user_team(id) == LeEquipe)){              load_menu(id);              return 1;         }     else if ((iVariable2 >= iNum)          && (cs_get_user_team(id) == LeEquipe2)){              load_menu(id);              return 1;         } } public clcmd_menu(id)     call_menu(CTVotes, TVotes, 3, CS_TEAM_T, CS_TEAM_CT);
There's better ways but this is the first thing that came in mind.

I did not follow your reasoning, can you exemplify me better?

iceeedr 05-07-2018 23:29

Re: Menu question
 
Solved, with a more relaxed mind read the amxx tutorial again and I got it.


All times are GMT -4. The time now is 04:32.

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