SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/07/2013, 05:18 AM   #1
ngumcutoi1999
Big Clucker
 
Join Date: Dec 2012
Location: Viet Nam
Posts: 71
Reputation: -3
Question Toys editor !

How to change this toy editor


to this

Please help me !
Old toy editor code
Code:
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));
	format(stringg, sizeof(stringg), "%sOffset Y (%f)\n", stringg,(PlayerToyInfo[playerid][slotselection[playerid]][ptPosY]*100));
	format(stringg, sizeof(stringg), "%sOffset Z (%f)\n", stringg,(PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ]*100));
	format(stringg, sizeof(stringg), "%sRotation X (%f)\n", stringg, PlayerToyInfo[playerid][slotselection[playerid]][ptRotX]);
	format(stringg, sizeof(stringg), "%sRotation Y (%f)\n", stringg, PlayerToyInfo[playerid][slotselection[playerid]][ptRotY]);
	format(stringg, sizeof(stringg), "%sRotation Z (%f)" ,stringg, PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ]);
 	ShowPlayerDialog(playerid, EDITTOYS2, DIALOG_STYLE_LIST, "Toy Menu: Edit", stringg, "Select", "Cancel");
}
ngumcutoi1999 is offline   Reply With Quote
Old 12/07/2013, 05:23 AM   #2
RealCop228
Godfather
 
Join Date: Feb 2010
Location: Springboro, OH
Posts: 8,265
Reputation: 670
Default Re: Toys editor !

http://wiki.sa-mp.com/wiki/EditAttachedObject

Please search before posting in the future. This topic has been brought up dozens of times!
__________________
Putting [URGENT] in the thread title stops me from opening the thread. Nobody else's problem on this forum is more important that another person's. Try not to be self-centered!
RealCop228 is offline   Reply With Quote
Old 12/07/2013, 05:35 AM   #3
ngumcutoi1999
Big Clucker
 
Join Date: Dec 2012
Location: Viet Nam
Posts: 71
Reputation: -3
Default Re: Toys editor !

toy.pwn(95) : error 017: undefined symbol "EditAttachedObject"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
ngumcutoi1999 is offline   Reply With Quote
Old 12/07/2013, 08:17 AM   #4
CIzaquita
Little Clucker
 
Join Date: Jan 2013
Posts: 30
Reputation: -1
Default Respuesta: Toys editor !

pawn Code:
enum attached_object_data
{
ao_model,
ao_bone,
Float:ao_x,
Float:ao_y,
Float:ao_z,
Float:ao_rx,
Float:ao_ry,
Float:ao_rz,
Float:ao_sx,
Float:ao_sy,
Float:ao_sz
}
 
new ao[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][attached_object_data];
 
// The data should be stored in the above array when attached objects are attached.
 
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
    if(response)
    {
        SendClientMessage(playeird, COLOR_GREEN, "Attached object edition saved.");
 
        ao[playerid][index][ao_x] = fOffsetX;
        ao[playerid][index][ao_y] = fOffsetY;
        ao[playerid][index][ao_z] = fOffsetZ;
        ao[playerid][index][ao_rx] = fRotX;
        ao[playerid][index][ao_ry] = fRotY;
        ao[playerid][index][ao_rz] = fRotZ;
        ao[playerid][index][ao_sx] = fScaleX;
        ao[playerid][index][ao_sy] = fScaleY;
        ao[playerid][index][ao_sz] = fScaleZ;
    }
    else
    {
        SendClientMessage(playeird, COLOR_RED, "Attached object edition not saved.");
 
        new i = index;
        SetPlayerAttachedObject(playerid, index, modelid, boneid, ao[playerid][i][ao_x], ao[playerid][i][ao_y], ao[playerid][i][ao_z], ao[playerid][i][ao_rx], ao[playerid][i][ao_ry], ao[playerid][i][ao_rz], ao[playerid][i][ao_sx], ao[playerid][i][ao_sy], ao[playerid][i][ao_sz]);
    }
    return 1;
}

http://wiki.sa-mp.com/wiki/OnPlayerEditAttachedObject
CIzaquita is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Add Toy's Editor Of 0.3e toys gun's ahmed0016255 Scripting Help 1 30/07/2013 01:40 PM
Can Anyone Help Me With Toys Editor? MrChopper Scripting Help 1 26/03/2013 12:36 PM
Toys Editor raamiix Scripting Help 4 13/03/2013 03:27 PM
About toys editor help me yaron0600 Scripting Help 1 06/01/2013 11:55 AM
Toys editor 0.3e Jassey Scripting Help 0 25/08/2012 06:11 AM


All times are GMT. The time now is 06:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.