Editing toy with arrows not being saved -
lider1241 - 30.08.2013
I have toy editor 0.3e in my server, after i buy a toy it placed randomaly on the character body, then i edit it to my custom offset for example on the head, then after i saved it i see it how i edited it but other people don't and by the way after deattach the toy/object it not saves the edit what means that it isn't save my editing.
i need a code to make it save the coordiantes/positions i edited.
I have edited the toy editor from coordiantes to arrows 0.3e
Picture:
Codes:
Код:
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)
{
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i)) EditAttachedObject(playerid, i);
}
SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Hold {A42AD1}LSHIFT {F2F299}to move your camera, press escape to cancel.");
return 1;
Код:
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\n", stringg,(PlayerToyInfo[playerid][slotselection[playerid]][ptPosX]*100));
Re: Editing toy with arrows not being saved -
lider1241 - 31.08.2013
Do you boycott me or what? please anyone help
Re: Editing toy with arrows not being saved -
JME - 31.08.2013
Try these:
Код:
if((dialogid == EDITTOYS2)) {
if(response) switch(listitem) {
case 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");
case 1:
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: Hold {8000FF}~k~~PED_SPRINT~ {FFFFAA}to move your camera, press escape to cancel");
EditAttachedObject(playerid, GetPVarInt(playerid, "ToySlot"));
}
Код:
stock ShowEditMenu(playerid)
{
new
iIndex = GetPVarInt(playerid, "ToySlot");
if(IsPlayerAttachedObjectSlotUsed(playerid, iIndex))
{
RemovePlayerAttachedObject(playerid, iIndex);
}
if(PlayerToyInfo[playerid][iIndex][ptScaleX] == 0) {
PlayerToyInfo[playerid][iIndex][ptScaleX] = 1.0;
PlayerToyInfo[playerid][iIndex][ptScaleY] = 1.0;
PlayerToyInfo[playerid][iIndex][ptScaleZ] = 1.0;
}
SetPlayerAttachedObject(playerid, iIndex, PlayerToyInfo[playerid][iIndex][ptModelID],
PlayerToyInfo[playerid][iIndex][ptBone], PlayerToyInfo[playerid][iIndex][ptPosX],
PlayerToyInfo[playerid][iIndex][ptPosY], PlayerToyInfo[playerid][iIndex][ptPosZ],
PlayerToyInfo[playerid][iIndex][ptRotX], PlayerToyInfo[playerid][iIndex][ptRotY],
PlayerToyInfo[playerid][iIndex][ptRotZ], PlayerToyInfo[playerid][iIndex][ptScaleX],
PlayerToyInfo[playerid][iIndex][ptScaleY], PlayerToyInfo[playerid][iIndex][ptScaleZ]);
new stringg[128];
format(stringg, sizeof(stringg), "Bone (%s)\nOffset", HoldingBones[PlayerToyInfo[playerid][iIndex][ptBone]]);
ShowPlayerDialog(playerid, EDITTOYS2, DIALOG_STYLE_LIST, "Toy Menu: Edit", stringg, "Select", "Cancel");
}