Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 7,239
» Latest member: qq88ooo
» Forum threads: 2,374
» Forum posts: 12,283
Full Statistics
|
Online Users |
There are currently 259 online users. » 0 Member(s) | 257 Guest(s) Bing, Google
|
Latest Threads |
Developer for Hire – Syst...
Forum: Pawn Scripting
Last Post: ejtamovic
Yesterday, 08:35 AM
» Replies: 0
» Views: 23
|
Liberty City map
Forum: Pawn Scripting
Last Post: ziyadprogamer
2025-06-28, 04:55 PM
» Replies: 2
» Views: 2,160
|
GameText styles in open.m...
Forum: Pawn Scripting
Last Post: Miki
2025-06-28, 01:25 PM
» Replies: 1
» Views: 51
|
Script[gamemodes/gamemode...
Forum: Pawn Scripting
Last Post: Miki
2025-06-27, 05:08 PM
» Replies: 1
» Views: 431
|
Want to edit my profile n...
Forum: Chat
Last Post: Hera.
2025-06-26, 08:41 PM
» Replies: 1
» Views: 568
|
Farsi
Forum: Other
Last Post: acc.gangbeni
2025-06-25, 08:21 AM
» Replies: 2
» Views: 3,071
|
Las Venturas Gang Wars - ...
Forum: Advertisements
Last Post: lvgwgta
2025-06-22, 06:47 PM
» Replies: 0
» Views: 64
|
[Request] Linko Gaming Ro...
Forum: General Discussions
Last Post: JamesC
2025-06-20, 07:34 PM
» Replies: 0
» Views: 82
|
RevolutionX DM/Stunt/Race...
Forum: Advertisements
Last Post: DerekZ905
2025-06-18, 03:12 PM
» Replies: 0
» Views: 94
|
samp-cef
Forum: Questions and Suggestions
Last Post: jamespssamp
2025-06-18, 11:36 AM
» Replies: 0
» Views: 83
|
|
|
Advanced Model Selection Menu (eSelection) |
Posted by: TommyB - 2020-12-02, 12:50 PM - Forum: Libraries
- Replies (3)
|
 |
eSelection
![[Image: sampctl-eSelection-2f2f2f.svg?style=for-the-badge]](https://img.shields.io/badge/sampctl-eSelection-2f2f2f.svg?style=for-the-badge)
This 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.
This 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.
![[Image: kvkg8t8.png]](https://i.imgur.com/kvkg8t8.png)
Installation
Simply install to your project:
Code: sampctl package install TommyB123/eSelection
Include in your code and begin using the library:
Functions
Adds a new model to a model selection list. Descriptive text and preview rotations are supported as optional arguments.
PHP Code: AddModelMenuItem(List:menulist, modelid, const text[] = "", bool:usingrotation = false, Float:rotx = 0.0, Float:roty = 0.0, Float:rotz = 0.0, Float:zoom = 1.0)
Shows a model selection menu to a player. OnModelSelectionResponse will be called when using this function.
PHP Code: ShowModelSelectionMenu(playerid, const header[], extraid, List:items)
Shows a model selection menu to a player. Requires waiting for a PawnPlus task to receive the response results.
PHP Code: Task:ShowAsyncModelSelectionMenu(playerid, const header[], List:items)
Non-task-based model selection menu responses are handled via the callback below.
PHP Code: public OnModelSelectionResponse(playerid, extraid, index, modelid, response)
extraid is the ID of the model menu provided in ShowModelSelectionMenu. This functionality is similar to the dialog ID argument in ShowPlayerDialog.
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.
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.
Relevant constants
MODEL_RESPONSE_CANCEL - Response value when a player cancels a model menu.
MODEL_RESPONSE_SELECT - Response value when a player clicks on a model inside of a model menu.
The following constants are used in the array response when handling a task-based model menu response.
E_MODEL_SELECTION_RESPONSE - The response value to be compared with the constants described above. Equiavelent to the response argument in OnModelSelectionResponse
E_MODEL_SELECTION_INDEX - The index of the model selection menu response. Equivalent to the index argument in OnModelSelectionResponse
E_MODEL_SELECTION_MODELID - The model ID of the model selection menu response. Equivalent to the modelid argument in OnModelSelectionResponse
Usage
Example of a traditional model selection response when using ShowModelSelectionMenu
PHP Code: // define an ID for the model selection menu below
#define MODEL_SELECTION_SKIN_MENU (0)
ShowSkinModelMenu(playerid)
{
? ? // create a dynamic PawnPlus list to populate with models.
? ? // you don't need to worry about deleting this list, it's handled by the include once it's passed to it
? ? new List:skins = list_new();
? ? // add skin IDs 0, 1, 29 and 60 with "cool people only" text above skin ID 29.
? ? AddModelMenuItem(skins, 0);
? ? AddModelMenuItem(skins, 1);
? ? AddModelMenuItem(skins, 29, "Cool people only");
? ? AddModelMenuItem(skins, 60);
? ? // show the menu to the player
? ? ShowModelSelectionMenu(playerid, "Skins", MODEL_SELECTION_SKIN_MENU, skins);
}
// model selection response
public OnModelSelectionResponse(playerid, extraid, index, modelid, response)
{
? ? // make sure the extraid matches the skin menu ID
? ? if(extraid == MODEL_SELECTION_SKIN_MENU)
? ? {
? ? ? ? // make sure the player actually clicked on a model and not the close button
? ? ? ? if(response == MODEL_RESPONSE_SELECT)
? ? ? ? {
? ? ? ? ? ? // assign the player the skin of their choosing
? ? ? ? ? ? SetPlayerSkin(playerid, modelid);
? ? ? ? ? ? return 1;
? ? ? ? }
? ? }
}
Example of waiting for a task-based model selection menu response with ShowAsyncModelSelectionMenu
PHP Code: // enable the "await" syntax from PawnPlus before including it
#define PP_SYNTAX_AWAIT
ShowSkinModelMenu(playerid)
{
? ? // create a dynamic PawnPlus list to populate with models.
? ? // you don't need to worry about deleting this list, it's handled by the include once it's passed to it
? ? new List:skins = list_new();
? ? // add skin IDs 0, 1, 29 and 60 with "cool people only" text above skin ID 29.
? ? AddModelMenuItem(skins, 0);
? ? AddModelMenuItem(skins, 1);
? ? AddModelMenuItem(skins, 29, "Cool people only");
? ? AddModelMenuItem(skins, 60);
? ? // declare an array that will be populated with the model selection menu response data
? ? new response[E_MODEL_SELECTION_INFO];
? ? // use await_arr and set the response array to the model selection menu result
? ? await_arr(response) ShowAsyncModelSelectionMenu(playerid, "Skins", skins);
? ? // make sure the player actually clicked on a model and not the close button
? ? if(response[E_MODEL_SELECTION_RESPONSE] == MODEL_RESPONSE_SELECT)
? ? {
? ? ? ? // assign the player the skin of their choosing
? ? ? ? SetPlayerSkin(playerid, response[E_MODEL_SELECTION_MODELID]);
? ? }
}
Credits
Interactive Roleplay Developer(s) - Original authors of this library
Me - Numerous feature updates, housekeeping, etc
|
|
|
[Ajuda] Formata??o de Cronometro |
Posted by: ztioluh - 2020-12-02, 11:20 AM - Forum: Portuguese/Portugu?s
- Replies (2)
|
 |
Estou criando um sistema de pris?o do zero que j? esta tudo ok por?m eu queria deixar o tempo exibido na textdraw no estilo "00:00:00".. atualmente fica "0:0:0".. E como n?o tenho experi?ncia o suficiente fiquei travado nisso.. Poderiam me ajudar a formatar dessa forma? Desde j? agrade?o.
|
|
|
samp-async-objects | Edit an object with pawnplus tasks! |
Posted by: Mergevos - 2020-12-01, 11:42 PM - Forum: Libraries
- No Replies
|
 |
Redirect to github:?
![[Image: Mergevos-samp--async--objects-2f2f2f.svg...-the-badge]](https://img.shields.io/badge/Mergevos-samp--async--objects-2f2f2f.svg?style=for-the-badge)
Installation
Simply install to your project:
Code: sampctl package install Mergevos/samp-async-objects
Include in your code and begin using the library:
Code: #include <async-objects>
Usage
Let's look at the following example:
Code: YCMD:test(playerid, params[], help)
{
? ? if(help) {
? ? ? ? return 0;
? ? }
? ? SelectObject(playerid);
? ? return 1;
}
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
{
? ? new obj_res[e_OBJECT_INFO];
? ? await_arr(obj_res) AsyncObject_Edit(playerid, objectid);
? ? print("Response awaited");
? ? if(obj_res[E_OBJECT_Response] == EDIT_RESPONSE_FINAL) {
? ? ? ? print("Response final, player clicked on save icon.");
? ? } else if(obj_res[E_OBJECT_Response] == EDIT_RESPONSE_CANCEL) {
? ? ? ? print("Canceled");
? ? }
? ? return 1;
}
The /test?command executes the SelectObject function which allows you to select an object you would like to edit. When you select the object it calls OnPlayerSelectObject, GUI is going to show up and allows you to edit, move, rotate and save the object changes. If you hit a cancel or the save button, it awaits task response and when it finishes, it returns task results in an array, thus, you can check, save and modify the object. In the code above, that array way obj_res, which is abbreviation of object_response, also, we've checked if player hit save button, a.k.a EDIT_RESPONSE_FINAL?or cancel button with obviously EDIT_RESPONSE_FINAL?and then we simply output a message. If, for some reason, messages didn't get output, then there's most likely a problem.
The functions you're going to use are:
Code: Task: AsyncObject_Edit(playerid, objectid)
The params are obvious, the function also has a wrapper. By defining `ASYNC_OBJECT_SYNTAX_EDIT` you allow yourself to use it:
Code: Task: EditObjectAsync(playerid, objectid)
Note: You've to put `OnPlayerEditObject` callback in your script.*
Testing
To test, simply run the package, connect to a server and then execute /test:
|
|
|
Fusez Map Editor not loading... |
Posted by: cristixxh - 2020-12-01, 07:25 PM - Forum: Support
- Replies (1)
|
 |
Hi there! I got Fusez Map Editor, and I have a hosted server especially for this. I got the editor files in the server files, i put "filterscripts mapedit" into server.cfg, and there is nothing. It should normally show me the controls when joining the server, but it's working just as the simple bare gamemode. Any help, please?
|
|
|
Texture Studio |
Posted by: Sprwok - 2020-11-30, 07:02 PM - Forum: Support
- No Replies
|
 |
Hi, I have a problem with texture studio. I don't know why he shows me this error:
[debug] Run time error 8: "Heap underflow"
[debug]? Heap pointer (HEA) is 0x2525C50, heap bottom (HLW) is 0x2BF8B5C
[debug] AMX backtrace:
I need some help with that, thank's.
|
|
|
My confusion with this new direction |
Posted by: Pufty - 2020-11-29, 07:47 PM - Forum: General Discussions
- Replies (1)
|
 |
Hi. Only recently (1 hour ago) did I realize the old sa-mp forum is down and all the links are dead/removed. I tried following up and it led me this far, where I should put my faith in this place to continue what's being lost. I read up a bit on Open.MP and noticed people type up things about C with mentions of Git etc...
My confusion comes from not knowing how to code... Recently only deciding to come back with requests by an old friend part of a really small RP community, I can't seem to understand how things will go down. Open.mp is going to be something new and refreshing to this old game, still being able run the old plugins, but also be able to affect the game with other coding languages than pawn? I know MTA has Lua and I couldn't learn Lua to make that transition, so I sticked with Pawn.
I'm good at visual stuff, not coding and would usually take snippets of code or with the help of 10 wiki tabs 10 forum tabs make the thing I want in Pawn to run on a Roleplay script. I used to just take a base script publicly available and alter that beyond recognition. It was really fun and it worked without me knowing anything, so I wonder if that's going to continue being the case or will I have to adapt and learn to actually code. I already couldn't find anything related to a dns.dll outside of the broken links still showing in search results and the git page that showed something of the sort needed Visual Studio.
I just wonder how events will play out. Is SA-MP as a client not going to be available soon enough and is OMP going to be a whole other level that I need to prepare for? I'm really glad there are actual QnA streams that I will go through, but right now I felt I would start off a written discussion to get my non-coder brain picked on.
|
|
|
Custom map in the form of chunks |
Posted by: dignity - 2020-11-29, 05:41 PM - Forum: Videos and Screenshots
- Replies (1)
|
 |
Hello all,
As some of you know previously on SA-MP I worked on many niche servers such as Wild West Roleplay, Medieval Roleplay, and more.?With the coming of Open MP the original team has been reinvigorated with energy to continue the medieval project as we all have high hopes for this mod.
We've decided to make a custom map consisting entirely of chunks, similar to how the original base game was made.?
This means all decoration is part of the model itself which severely reduces object count. We have a system ingame that allows us to enable/disable chunks willingly as well as the ability for players to enable/disable shrubs based on their machine's performance.
Here are some renders and test images from the very first chunk we made, and below is also a video of the entire rendering system in action. (64x64 chunks, on a brazilian server for reasons)
https://i.imgur.com/lzfxI4v.png
https://cdn.discordapp.com/attachments/6...nknown.png
[Video: https://www.youtube.com/watch?v=dw0zycPk...e=youtu.be]
Thanks and let me know what you think!
PS: the bugs in the video are already patched :)
|
|
|
|