splewis / csgo-retakes

CS:GO Sourcemod plugin for a site-retake gamemode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Understand the retakes_standardallocator.sp

enghausen opened this issue · comments

Hi,

I am getting back to some old project regarding customized retake servers and I am getting in to SourcePawn again. I am making a new weapons allocator just to try it out. I was looking in the retakes_standardallocator.sp for some inspiration, but I don't understand this:

public int MenuHandler_CTRifle(Menu menu, MenuAction action, int param1, int param2) {
if (action == MenuAction_Select) {
int client = param1;
char choice[WEAPON_STRING_LENGTH];
menu.GetItem(param2, choice, sizeof(choice));
g_CTRifleChoice[client] = choice;
SetClientCookie(client, g_hCTRifleChoiceCookie, choice);
TRifleMenu(client);
} else if (action == MenuAction_End) {
delete menu;
}
}

Line 150:
Why would you call the TRifleMenu(client); (from the MenuHandler_CTRifle) and not just the GiveAwpMenu(client); like you do in the MenuHandler_TRifle?

I dont understand why a TRifleMenu is in the CTRifle Handler?

Cheers!

the menus are displayed in sequence after executing the guns command. ct choice, then t choice, then awp choice.

Sorry, I just assumed the menu only was shown for either CT or T! I did not catch you was not doing any player/side detection!

Thank you very much for this great plugin!

Feel free to close this :-)