EditPlayerAttachedObject
#1

Hello,
I wanted to ask that how can we make player edit his attached object,I know the command that is EditPlayerAttachedObject but I can't really use it as I am new at scripter.Please someone post a little code.And how to save that into a slot and playerfile.
Reply
#2

It's EditAttachedObject and it's well-explained in the wiki page.

An example from the wiki with some comments:
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerAttachedObject(playerid, 0, 1337, 2); // second parameter (0) is the slot id that you will need in EditAttachedObject
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/edit", true))
    {
        EditAttachedObject(playerid, 0); // second parameter (0) is the slot we used in SetPlayerAttachedObject
        // so if you have used SetPlayerAttachedObject like this SetPlayerAttachedObject(playerid, 1, 1337, 2);
        // then your EditAttachedObject function should be like this EditAttachedObject(playerid, 1); to edit the attached object in the slot 1
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You now edit your attached object on index slot 0!");
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)