Toy Editor
#1

Alright so basically what I am trying to do is make a menu which displays "Bone" and "Edit" with buttons "Select" and "Cancel" So when you click Edit the new toy editor appears. But when you click Bone the toy editor doesn't appear yet. So basically below is some of the unfinished code im working on


Код:
stock ShowEditMenu(playerid)
{
    if(IsPlayerAttachedObjectSlotUsed(playerid, slotselection[playerid]))
	{
 		RemovePlayerAttachedObject(playerid, slotselection[playerid]);
	}
	SetPlayerAttachedObject(playerid, slotselection[playerid], PlayerToyInfo[playerid][slotselection[playerid]][ptModelID],
	PlayerToyInfo[playerid][slotselection[playerid]][ptBone], PlayerToyInfo[playerid][slotselection[playerid]][ptPosX],
	PlayerToyInfo[playerid][slotselection[playerid]][ptPosY], PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ],
	PlayerToyInfo[playerid][slotselection[playerid]][ptRotX], PlayerToyInfo[playerid][slotselection[playerid]][ptRotY],
	PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ], 1, 1, 1);

    new stringg[512];
    format(stringg, sizeof(stringg), "%sBone (%s)\n", stringg, HoldingBones[PlayerToyInfo[playerid][slotselection[playerid]][ptBone]]);
	format(stringg, sizeof(stringg), "%sOffset X (%f)\n", stringg,(PlayerToyInfo[playerid][slotselection[playerid]][ptPosX]*100));
 	ShowPlayerDialog(playerid, EDITTOYS2, DIALOG_STYLE_LIST, "Toy Menu: Edit", stringg, "Select", "Cancel");
}
So basically this line here >
Код:
format(stringg, sizeof(stringg), "%sOffset X (%f)\n", stringg,(PlayerToyInfo[playerid][slotselection[playerid]][ptPosX]*100));
Needs to stay but when you click it it needs to bring you to the new toy editor.

And i tried this but it didn't work and just gave me errors.

Код:
format(stringg, sizeof(stringg), "%sOffset X (%f)\n", stringg,(EditAttachedObject(playerid, 0)));
this is the simple easy code for the new toy/object editor that i need.
Код:
EditAttachedObject(playerid, 0)
EDIT: BTW I want this as a dialog not command.
Reply
#2

Alright I edited it some and here is what i got.

New Code-
Код:
	format(stringg, sizeof(stringg), "%sOffset (%f)\n", stringg,(PlayerToyInfo[playerid][EditAttachedObject]));
Errors-
Код:
C:\Users\User\Desktop\Roleplay\Windows Server\gamemodes\RP.pwn(71591) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#3

Bump - Still haven't gotten help please do.
Reply
#4

You need to add it to OnDialogResponse:

pawn Код:
if(dialogid == EDITTOYS2)
{
    if(response)
    {
        switch(listitem)
        {
            case 1:
            {
                EditAttachedObject(playerid, 0);
            }
        }
    }
}
Reply
#5

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
You need to add it to OnDialogResponse:

pawn Код:
if(dialogid == EDITTOYS2)
{
    if(response)
    {
        switch(listitem)
        {
            case 1:
            {
                EditAttachedObject(playerid, 0);
            }
        }
    }
}
Alright how can i input that into this -

Код:
stock ShowEditMenu(playerid)
{
    if(IsPlayerAttachedObjectSlotUsed(playerid, slotselection[playerid]))
	{
 		RemovePlayerAttachedObject(playerid, slotselection[playerid]);
	}
	SetPlayerAttachedObject(playerid, slotselection[playerid], PlayerToyInfo[playerid][slotselection[playerid]][ptModelID],
	PlayerToyInfo[playerid][slotselection[playerid]][ptBone], PlayerToyInfo[playerid][slotselection[playerid]][ptPosX],
	PlayerToyInfo[playerid][slotselection[playerid]][ptPosY], PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ],
	PlayerToyInfo[playerid][slotselection[playerid]][ptRotX], PlayerToyInfo[playerid][slotselection[playerid]][ptRotY],
	PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ], 1, 1, 1);

    new stringg[512];
    format(stringg, sizeof(stringg), "%sBone (%s)\n", stringg, HoldingBones[PlayerToyInfo[playerid][slotselection[playerid]][ptBone]]);
 	ShowPlayerDialog(playerid, EDITTOYS2, DIALOG_STYLE_LIST, "Toy Menu: Edit", stringg, "Select", "Cancel");
}
Reply
#6

Quote:
Originally Posted by Johnny_Robins
Посмотреть сообщение
Alright how can i input that into this -

Код:
...
Keep it like you had in the first post.

pawn Код:
format(stringg, sizeof(stringg), "%sOffset X (%f)\n", stringg,(PlayerToyInfo[playerid][slotselection[playerid]][ptPosX]*100));
Reply
#7

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Keep it like you had in the first post.

pawn Код:
format(stringg, sizeof(stringg), "%sOffset X (%f)\n", stringg,(PlayerToyInfo[playerid][slotselection[playerid]][ptPosX]*100));
That is to edit the X position im using the new edit menu.
https://sampwiki.blast.hk/wiki/EditAttachedObject
Reply
#8

It only allows me to set the X how do I input "EditAttachedObject"
Reply
#9

Do you have OnDialogResponse in your script?
Do you have dialogid EDITTOYS2 handled in there?
Reply
#10

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Do you have OnDialogResponse in your script?
Do you have dialogid EDITTOYS2 handled in there?
I have EDITTOYS2 yes but there isn't a line of OnDialogResponse

Wait I have this line which is when i click the Edit button. this comes up

Код:
		        ShowPlayerDialog(playerid, EDITTOYSPX, DIALOG_STYLE_INPUT, "Toy Menu: Edit", "Input an X Offset from -100 to 100 (Ex: 55, or 33.4)", "Enter", "Cancel");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)