SA-MP Forums Archive
[Include] acMenu.inc || Create circulars menus with only one line. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] acMenu.inc || Create circulars menus with only one line. (/showthread.php?tid=439500)

Pages: 1 2


acMenu.inc || Create circulars menus with only one line. - adri1 - 25.05.2013

Video
[ame="http://www.youtube.com/watch?v=DTV5tC_gFUE"]*******[/ame]

With this you can create circulars menus , with only one line.
Code:
ShowCircularMenu(
	playerid,                   =   Player ID
	circularmenuid,             =   Circular Menu ID (See*)
	off[],                      =   Button OFF text
	txd1[]="", line1[]="",      =   Line 1 sprite & text
	txd2[]="", line2[]="",      =   Line 2 sprite & text
	txd3[]="", line3[]="",      =   Line 3 sprite & text
	txd4[]="", line4[]="",      =   Line 4 sprite & text
	txd5[]="", line5[]="",      =   Line 5 sprite & text
	txd6[]="", line6[]="",      =   Line 6 sprite & text
	txd7[]="", line7[]="",      =   Line 7 sprite & text
	txd8[]="", line8[]=""       =   Line 8 sprite & text
);
* Note that by default you can only create 10 menu per player , so if you create more than 10 menus or id puts more than 10 will not work, not being to change 'MAX_CM_DIALOGS'

Callback
OnCircularMenuResponse is called when there is something on the menu:

Code:
OnCircularMenuResponse(
	playerid,   		=   Player ID
	response,   		=   if false, it means I press the OFF button, or pressed ESC
	circularmenuid,   	=   Circular menu id
	listitem    		=   Listitem ... direction clockwise (See**)
);
** image


Example code:
Code:
#include <aCMenu>
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/b", true))
    {
        ShowCircularMenu(playerid, 0, "close", "hud:radar_qmark", "1", "hud:radar_qmark", "2", "hud:radar_qmark", "3", "hud:radar_qmark", "4", "hud:radar_qmark", "5", "hud:radar_qmark", "6", "hud:radar_qmark", "7", "hud:radar_qmark", "8");
		return 1;
	}
	if(!strcmp(cmdtext, "/c", true))
    {
        ShowCircularMenu(playerid, 1, "cerrar", "hud:radar_gangB", "cuenta", "hud:radar_LocoSyndicate", "dni", "hud:arrow", "localizacion", "hud:radar_modGarage", "ajustes", "hud:radar_qmark", "info", "hud:radar_enemyAttack", "creditos", "hud:radar_dateFood", "lugares", "hud:radar_race", "premios");
		return 1;
	}
	return 0;
}

public OnCircularMenuResponse(playerid, response, circularmenuid, listitem)
{
	switch(circularmenuid)
	{
	    case 0:
	    {
	        if(response)
			{
			    switch(listitem)
			    {
			    	case 0: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}1");
				    case 1: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}2");
				    case 2: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}3");
				    case 3: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}4");
				    case 4: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}5");
				    case 5: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}6");
				    case 6: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}7");
				    case 7: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}8");
			    }
	        }
	        else SendClientMessage(playerid, -1, "Has cerrado el menъ {00CCFF}#0");
	    }
	    case 1:
	    {
	        if(response)
			{
			    switch(listitem)
			    {
			    	case 0: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}cuenta");
				    case 1: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}dni");
				    case 2: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}localizaciуn");
				    case 3: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}ajustes");
				    case 4: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}info");
				    case 5: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}crйditos");
				    case 6: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}lugares");
				    case 7: SendClientMessage(playerid, -1, "Has presionado en {00CCFF}premios");
			    }
	        }
	        else SendClientMessage(playerid, -1, "Has cerrado el menъ {00CCFF}#1");
	    }
	}
	return 1;
}
Credits
adri1

Download (SolidFiles) V2.0 fixed.
Download (SolidFiles) V1.0


Re: acMenu.inc || Create circulars menus with only one line. - Littlehelper - 25.05.2013

It is pretty awesome!


Re: acMenu.inc || Create circulars menus with only one line. - IstuntmanI - 25.05.2013

This is one of the most unique things I saw there, great job !

I love the callback.


Re: acMenu.inc || Create circulars menus with only one line. - Rock - 25.05.2013

Quote:
Originally Posted by IstuntmanI
View Post
This is one of the most unique things I saw there, great job !
Indeed.
After all those shity includes I finally see something unique!


Re: acMenu.inc || Create circulars menus with only one line. - Pottus - 25.05.2013

You should round some of the creation position values to whole numbers otherwise it might look bad on lower resolutions.

Why is there the need for Pvars? Why bother?


Re: acMenu.inc || Create circulars menus with only one line. - Lorenc_ - 26.05.2013

Great job! Pastebin link? I want to view the source :P

By the looks in the code, you can't move the position mhm. Very nice idea for a survival server.


Re: acMenu.inc || Create circulars menus with only one line. - Kar - 26.05.2013

pastebin?


Respuesta: Re: acMenu.inc || Create circulars menus with only one line. - adri1 - 26.05.2013

Quote:
Originally Posted by Kar
View Post
pastebin?
http://pastebin.com/w88Y8wMq

___
Edit: Updated to 1.5...
Repair errors:
pawn Code:
.pwn() : error 021: symbol already defined: "AC_OPC"
.pwn() : error 021: symbol already defined: "AC_OPDC"



AW: acMenu.inc || Create circulars menus with only one line. - BigETI - 26.05.2013

From your filterscript version:
Quote:
Quote:
Originally Posted by BigETI
View Post
This is a nice idea, but this could be done much more dynamic for example you can add "n" amount of items into the circle, and use the "in front of point" calculation to calculate the positions of each item around the circle.
Quote:
Originally Posted by [uL]Pottus
View Post
That would be the best way to do it, I was actually thinking this before you mentioned it also it would be nice if you could specify ring styles, position, size.
I haven't check your include version yet, but can I make a version from scratch which supports loading and saving menu templates, showing menus with n amount of items, if you don't mind?
You will be included into the credits for the initial idea.


Re: acMenu.inc || Create circulars menus with only one line. - [DOG]irinel1996 - 26.05.2013

Seems nice, good job.


Respuesta: AW: acMenu.inc || Create circulars menus with only one line. - adri1 - 26.05.2013

Quote:
Originally Posted by BigETI
Посмотреть сообщение
From your filterscript version:


I haven't check your include version yet, but can I make a version from scratch which supports loading and saving menu templates, showing menus with n amount of items, if you don't mind?
You will be included into the credits for the initial idea.
No problem


Re: acMenu.inc || Create circulars menus with only one line. - Abhishek. - 26.05.2013

OMG
here start a new era i guess this just started giveing me new ideas


Re: acMenu.inc || Create circulars menus with only one line. - [IZ]Kira - 26.05.2013

Wow man , great job ! It is awesome :]


Re: acMenu.inc || Create circulars menus with only one line. - RaZzZzoR - 26.05.2013

Amazing script ! Keep up.


Re: acMenu.inc || Create circulars menus with only one line. - Glad2BeHere - 02.06.2013

just beautiful, great idea.....


Re: acMenu.inc || Create circulars menus with only one line. - TheArcher - 02.06.2013

Very awesome! :O


Re: acMenu.inc || Create circulars menus with only one line. - Ballu Miaa - 03.06.2013

Ayoooooooooo adri. Woooooooooooooooooooooo You fucked it this time. Dammit. Insane work man. Loved it. Rep+4

Try making auto moving menus now or some sliders or etc.


Re: acMenu.inc || Create circulars menus with only one line. - drichie - 03.06.2013

i will try to convert my gps into this nyc job very very unique


Re : acMenu.inc || Create circulars menus with only one line. - JacobWilkerson - 26.12.2013

fail


Re: acMenu.inc || Create circulars menus with only one line. - Alphlax - 30.12.2013

aWESOME SCRIPT