[HELP] How to add 0.3e toy Editor.
#1

Hey Guys,
I need some help here.

I got problem when i do /toys then i click edit , it must edit X Y Z and Rot X Y Z too.
And i want to add 0.3e toy Editor , How to do it ?

This the /toys Code :
Код:
	if((dialogid == TOYS) && response)
	{
		if(listitem == 0)
		{
			new stringg[512];
			for(new x;x<MAX_PLAYERTOYS;x++)
			{
				new name[24];
				format(name, sizeof(name), "None");

				for(new i;i<sizeof(HoldingObjectsAll);i++)
				{
					if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
					}
				}
                for(new i;i<sizeof(HoldingObjectsPlat);i++)
				{
					if(HoldingObjectsPlat[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsPlat[i][holdingmodelname]);
					}
				}
				format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
			}
			ShowPlayerDialog(playerid, WEARTOY, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel");
		}
		else if(listitem == 1)
		{
			new stringg[512];
			for(new x;x<MAX_PLAYERTOYS;x++)
			{
				new name[24];
				format(name, sizeof(name), "None");

				for(new i;i<sizeof(HoldingObjectsAll);i++)
				{
					if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
					}
				}
				for(new i;i<sizeof(HoldingObjectsPlat);i++)
				{
					if(HoldingObjectsPlat[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsPlat[i][holdingmodelname]);
					}
				}

				format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
			}
			ShowPlayerDialog(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel");
		}
		else if(listitem == 2)
		{
			new stringg[512];
			for(new x;x<MAX_PLAYERTOYS;x++)
			{
				new name[24];
				format(name, sizeof(name), "None");

				for(new i;i<sizeof(HoldingObjectsAll);i++)
				{
					if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
					}
				}
				for(new i;i<sizeof(HoldingObjectsPlat);i++)
				{
					if(HoldingObjectsPlat[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsPlat[i][holdingmodelname]);
					}
				}

				format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
			}
			ShowPlayerDialog(playerid, DELETETOY, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Delete", "Cancel");
		}
	}

	if((dialogid == EDITTOYS) && response)
	{
		if(PlayerToyInfo[playerid][listitem][ptModelID] == 0)
		{
			ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu: Edit", "Woops! You don't have anything on that slot", "OK", "");
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "{AA3333}HINT:{FFFF00} Position your camera differently to better see where your editing.");
			slotselection[playerid] = listitem;
			ShowEditMenu(playerid);
		}
	}
	if((dialogid == EDITTOYS2))
	{
		if(response)
		{
			if(listitem == 0)
			{
				ShowPlayerDialog(playerid, EDITTOYSBONE, DIALOG_STYLE_LIST, "Select a Bone", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft clavicle\nRight clavicle\nNeck\nJaw", "Select", "Cancel");
			}
			else if(listitem == 1)
			{
				ShowPlayerDialog(playerid, EDITTOYSPX, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an X Offset from -100 to 100 (Ex: 55, or 33.4)", "Enter", "Cancel");
			}
			else if(listitem == 2)
			{
				ShowPlayerDialog(playerid, EDITTOYSPY, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Y Offset from -100 to 100 (Ex: 55, or 33.4)", "Enter", "Cancel");
			}
			else if(listitem == 3)
			{
				ShowPlayerDialog(playerid, EDITTOYSPZ, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Z Offset from -100 to 100 (Ex: 55, or 33.4)", "Enter", "Cancel");
			}
			else if(listitem == 4)
			{
				ShowPlayerDialog(playerid, EDITTOYSRX, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an X Rotation from 0 to 360 (Ex: 90, or 270.4)", "Enter", "Cancel");
			}
			else if(listitem == 5)
			{
				ShowPlayerDialog(playerid, EDITTOYSRY, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Y Rotation from 0 to 360 (Ex: 90, or 270.4)", "Enter", "Cancel");
			}
			else if(listitem == 6)
			{
				ShowPlayerDialog(playerid, EDITTOYSRZ, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an Z Rotation from 0 to 360 (Ex: 90, or 270.4)", "Enter", "Cancel");
			}
			else if(listitem == 7)
			{
				ShowPlayerDialog(playerid, EDITTOYSSX, DIALOG_STYLE_INPUT, "Toy Menu: Edit","Input an X Scale from 0.5 to 2", "Enter", "Cancel");
			}
			else if(listitem == 8)
			{
				ShowPlayerDialog(playerid, EDITTOYSSY, DIALOG_STYLE_INPUT, "Toy Menu: Edit","Input an Y Scale from 0.5 to 2", "Enter", "Cancel");
			}
			else if(listitem == 9)
			{
				ShowPlayerDialog(playerid, EDITTOYSSZ, DIALOG_STYLE_INPUT, "Toy Menu: Edit","Input an Z Scale from 0.5 to 2", "Enter", "Cancel");
			}
		}
		else
		{
			new stringg[512];
			for(new x;x<MAX_PLAYERTOYS;x++)
			{
				new name[24];
				format(name, sizeof(name), "None");

				for(new i;i<sizeof(HoldingObjectsAll);i++)
				{
					if(HoldingObjectsAll[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsAll[i][holdingmodelname]);
					}
				}
				for(new i;i<sizeof(HoldingObjectsPlat);i++)
				{
					if(HoldingObjectsPlat[i][holdingmodelid] == PlayerToyInfo[playerid][x][ptModelID])
					{
						format(name, sizeof(name), "%s", HoldingObjectsPlat[i][holdingmodelname]);
					}
				}
				format(stringg, sizeof(stringg), "%s(%d) %s (Bone: %s)\n", stringg, x, name, HoldingBones[PlayerToyInfo[playerid][x][ptBone]]);
			}
			ShowPlayerDialog(playerid, EDITTOYS, DIALOG_STYLE_LIST, "Select a Toy", stringg, "Select", "Cancel");
		}
	}
	if(dialogid == EDITTOYSPX)
	{
		if(response)
		{
			new Float:offset = floatstr(inputtext);
			if(offset < -100) offset = 0;
			else if(offset > 100) offset = 100;
			offset = offset/100;
			PlayerToyInfo[playerid][slotselection[playerid]][ptPosX] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSPY)
	{
		if(response)
		{
			new Float:offset = floatstr(inputtext);
			if(offset < -100) offset = 0;
			else if(offset > 100) offset = 100;
			offset = offset/100;
			PlayerToyInfo[playerid][slotselection[playerid]][ptPosY] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSPZ)
	{
		if(response)
		{
			new Float:offset = floatstr(inputtext);
			if(offset < -100) offset = 0;
			else if(offset > 100) offset = 100;
			offset = offset/100;
			PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSRX)
	{
		if(response)
		{
			new Float:offset = floatstr(inputtext);
			if(offset < -100) offset = 0;
			else if(offset > 360) offset = 360;
			PlayerToyInfo[playerid][slotselection[playerid]][ptRotX] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSRY)
	{
		if(response)
		{
			new Float:offset = floatstr(inputtext);
			if(offset < -100) offset = 0;
			else if(offset > 360) offset = 360;
			PlayerToyInfo[playerid][slotselection[playerid]][ptRotY] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSRZ)
	{
		if(response)
		{
			new Float:offset = floatstr(inputtext);
			if(offset < -100) offset = 0;
			else if(offset > 360) offset = 360;
			PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSSX)
	{
	    if(response)
	    {
	        new Float:offset = floatstr(inputtext);
	        if(offset < 0.5 && PlayerInfo[playerid][pAdmin] < 1337) offset = 0.5;
			else if(offset > 2 && PlayerInfo[playerid][pAdmin] < 1337) offset = 2;
	        PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSSY)
	{
	    if(response)
	    {
	        new Float:offset = floatstr(inputtext);
	        if(offset < 0.5 && PlayerInfo[playerid][pAdmin] < 1337) offset = 0.5;
			else if(offset > 2 && PlayerInfo[playerid][pAdmin] < 1337) offset = 2;
	        PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSSZ)
	{
	    if(response)
	    {
	        new Float:offset = floatstr(inputtext);
	        if(offset < 0.5 && PlayerInfo[playerid][pAdmin] < 1337) offset = 0.5;
			else if(offset > 2 && PlayerInfo[playerid][pAdmin] < 1337) offset = 2;
	        PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ] = offset;
		}
		ShowEditMenu(playerid);
	}
	if(dialogid == EDITTOYSBONE)
	{
		if(response)
		{
			PlayerToyInfo[playerid][slotselection[playerid]][ptBone] = listitem+1;
		}
		ShowEditMenu(playerid);
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)