Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understand the retakes_standardallocator.sp #310

Closed
enghausen opened this issue Jan 6, 2022 · 2 comments
Closed

Understand the retakes_standardallocator.sp #310

enghausen opened this issue Jan 6, 2022 · 2 comments

Comments

@enghausen
Copy link

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!

@splewis
Copy link
Owner

splewis commented Jan 6, 2022

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

@enghausen
Copy link
Author

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants