{"id":22813406,"url":"https://github.com/tommyb123/eselection","last_synced_at":"2026-02-08T11:03:28.240Z","repository":{"id":40258475,"uuid":"283002601","full_name":"TommyB123/eSelection","owner":"TommyB123","description":"Dynamic model selection library for SA-MP servers","archived":false,"fork":false,"pushed_at":"2024-02-22T03:18:19.000Z","size":38,"stargazers_count":49,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T00:31:06.611Z","etag":null,"topics":["eselection","model","mselection","pawnplus","sa-mp","samp","selection"],"latest_commit_sha":null,"homepage":"","language":"Pawn","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TommyB123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-27T19:59:37.000Z","updated_at":"2025-07-15T10:03:13.000Z","dependencies_parsed_at":"2022-08-17T20:55:15.424Z","dependency_job_id":"50600bc8-78f6-4359-baf6-20b23d58fa2d","html_url":"https://github.com/TommyB123/eSelection","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/TommyB123/eSelection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyB123%2FeSelection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyB123%2FeSelection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyB123%2FeSelection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyB123%2FeSelection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TommyB123","download_url":"https://codeload.github.com/TommyB123/eSelection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TommyB123%2FeSelection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29228550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T09:43:19.170Z","status":"ssl_error","status_checked_at":"2026-02-08T09:42:55.556Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eselection","model","mselection","pawnplus","sa-mp","samp","selection"],"created_at":"2024-12-12T12:27:28.939Z","updated_at":"2026-02-08T11:03:28.222Z","avatar_url":"https://github.com/TommyB123.png","language":"Pawn","readme":"# eSelection\n\n[![sampctl](https://img.shields.io/badge/sampctl-eSelection-2f2f2f.svg?style=for-the-badge)](https://github.com/TommyB123/eSelection)\n\nThis library adds the ability to create dynamic model selection menus in your SA-MP gamemodes. It's an edit of the original eSelection include created by the developers of the Interactive Roleplay SA-MP server back in 2013. I've been using it in my own server for many years and made countless adjustments, fixes, optimizations and feature changes to it. After a bit of consideration, I decided to open source the changes I've made.\n\nThis edit (well, it's closer to a rewrite) makes use of dynamic PawnPlus containers, adds in an improved API, descriptive text per model preview and also adds the ability to call task-based menu responses, which will be demonstrated below.\n\n![](https://i.imgur.com/wDal7si.png)\n![](https://i.imgur.com/kvkg8t8.png)\n\n## Installation\n\nSimply install to your project:\n\n```bash\nsampctl package install TommyB123/eSelection\n```\n\nInclude in your code and begin using the library:\n\n```pawn\n#include \u003ceSelection\u003e\n```\n\n## Functions\n\nAdds a new model to a model selection list. Descriptive text and preview rotations are supported as optional arguments.\n\n```pawn\nAddModelMenuItem(List:menulist, modelid, const text[] = \"\", bool:usingrotation = false, Float:rotx = 0.0, Float:roty = 0.0, Float:rotz = 0.0, Float:zoom = 1.0)\n```\n\nShows a model selection menu to a player. `OnModelSelectionResponse` will be called when using this function. \n\n```pawn\nShowModelSelectionMenu(playerid, const header[], extraid, List:items)\n```\nShows a model selection menu to a player. Requires waiting for a PawnPlus task to receive the response results.\n\n```pawn\nTask:ShowAsyncModelSelectionMenu(playerid, const header[], List:items)\n```\n\nNon-task-based model selection menu responses are handled via the callback below.\n\n```pawn\npublic OnModelSelectionResponse(playerid, extraid, index, modelid, response)\n```\n\n`extraid` is the ID of the model menu provided in `ShowModelSelectionMenu`. This functionality is similar to the dialog ID argument in `ShowPlayerDialog`.\n\n`index` is the list index of the model that was clicked. If the first model in a menu is clicked, `index` will 0. If the second model is clicked, `index` will be 1. You get the point, I hope.\n\n`modelid` is the model ID that was clicked. If a player clicks on skin ID 5 in a model menu, this variable would also be 5.\n\n## Relevant constants\n`MODEL_RESPONSE_CANCEL` - Response value when a player cancels a model menu.\n\n`MODEL_RESPONSE_SELECT` - Response value when a player clicks on a model inside of a model menu.\n\nThe following constants are used in the array response when handling a task-based model menu response.\n\n`E_MODEL_SELECTION_RESPONSE` - The response value to be compared with the constants described above. Equiavelent to the `response` argument in `OnModelSelectionResponse`\n\n`E_MODEL_SELECTION_INDEX` - The index of the model selection menu response. Equivalent to the `index` argument in `OnModelSelectionResponse`\n\n`E_MODEL_SELECTION_MODELID` - The model ID of the model selection menu response. Equivalent to the `modelid` argument in `OnModelSelectionResponse`\n\n## Usage\nExample of a traditional model selection response when using `ShowModelSelectionMenu`\n```pawn\n// define an ID for the model selection menu below\n#define MODEL_SELECTION_SKIN_MENU (0)\n\nShowSkinModelMenu(playerid)\n{\n    // create a dynamic PawnPlus list to populate with models.\n    // you don't need to worry about deleting this list, it's handled by the include once it's passed to it\n    new List:skins = list_new();\n\n    // add skin IDs 0, 1, 29 and 60 with \"cool people only\" text above skin ID 29.\n    AddModelMenuItem(skins, 0);\n    AddModelMenuItem(skins, 1);\n    AddModelMenuItem(skins, 29, \"Cool people only\");\n    AddModelMenuItem(skins, 60);\n\n    // show the menu to the player\n    ShowModelSelectionMenu(playerid, \"Skins\", MODEL_SELECTION_SKIN_MENU, skins);\n}\n\n// model selection response\npublic OnModelSelectionResponse(playerid, extraid, index, modelid, response)\n{\n    // make sure the extraid matches the skin menu ID\n    if(extraid == MODEL_SELECTION_SKIN_MENU)\n    {\n        // make sure the player actually clicked on a model and not the close button\n        if(response == MODEL_RESPONSE_SELECT)\n        {\n            // assign the player the skin of their choosing\n            SetPlayerSkin(playerid, modelid);\n            return 1;\n        }\n    }\n}\n```\n\nExample of waiting for a task-based model selection menu response with `ShowAsyncModelSelectionMenu`\n\n```pawn\n// enable the \"await\" syntax from PawnPlus before including it\n#define PP_SYNTAX_AWAIT\n\nShowSkinModelMenu(playerid)\n{\n    // create a dynamic PawnPlus list to populate with models.\n    // you don't need to worry about deleting this list, it's handled by the include once it's passed to it\n    new List:skins = list_new();\n\n    // add skin IDs 0, 1, 29 and 60 with \"cool people only\" text above skin ID 29.\n    AddModelMenuItem(skins, 0);\n    AddModelMenuItem(skins, 1);\n    AddModelMenuItem(skins, 29, \"Cool people only\");\n    AddModelMenuItem(skins, 60);\n\n    // declare an array that will be populated with the model selection menu response data\n    new response[E_MODEL_SELECTION_INFO];\n\n    // use await_arr and set the response array to the model selection menu result\n    await_arr(response) ShowAsyncModelSelectionMenu(playerid, \"Skins\", skins);\n\n    // make sure the player actually clicked on a model and not the close button\n    if(response[E_MODEL_SELECTION_RESPONSE] == MODEL_RESPONSE_SELECT)\n    {\n        // assign the player the skin of their choosing\n        SetPlayerSkin(playerid, response[E_MODEL_SELECTION_MODELID]);\n    }\n}\n```\n\n## Credits\nInteractive Roleplay Developer(s) - Original authors of this library\n\nMe - Numerous feature updates, housekeeping, etc","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommyb123%2Feselection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommyb123%2Feselection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommyb123%2Feselection/lists"}