player objact
#1

how to add 19472 on player head?im not understand SetPlayerAttachedObject.please full help.
Reply
#2

Well, you could make it so the player can set the mask themselves with EditObject, that's one way of doing it
Reply
#3

Search before you post next time.
PHP код:
CMD:mask(playerid,params[]) {
    
SetPlayerAttachedObject(playerid1194722104.70.090900);
    return 
true;

https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject
Reply
#4

Quote:
Originally Posted by Jay_Dixon
Посмотреть сообщение
Well, you could make it so the player can set the mask themselves with EditObject, that's one way of doing it
this is it:
https://sampwiki.blast.hk/wiki/EditObject

or software?
Reply
#5

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
You can attach the objects anywhere on a player by manually scripting it or by using the ever popular Hold Studio by Slice.
Yes, you can also SetPlayerAttachedObject() and change it's position, rotation with SA:MP's internal tool by calling EditAttachedObject().
Reply
#6

i set objact pos with this:
Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerAttachedObject(playerid, 0, 1337, 2);
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/edit", true))
    {
        EditAttachedObject(playerid, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You now edit your attached object on index slot 0!");
        return 1;
    }
    return 0;
}
And then?
for save it?
this is not works:
Код:
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(playerid, 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(playerid, 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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)