SA-MP Forums Archive
OnPlayerModelSelection problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerModelSelection problem (/showthread.php?tid=504705)



OnPlayerModelSelection problem - Tadas - 05.04.2014

Hello, I tryed to do a AttachedObject selection, but it don't work. This is that code what i tryed:
pawn Код:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
    if(listid == daiktai)
    {
        if(response)
        {
        SetPlayerAttachedObject(playerid,modelid);
        }
        else SendClientMessage(playerid, RAUDONA, "Atрaukta!");
    }
    return 1;
}
How to fix that ?


Re: OnPlayerModelSelection problem - Lidor124 - 05.04.2014

Maybe becasue you don't have the full parameters?

Quote:

SetPlayerAttacheObject(playerid, index, modelid, bone, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);

https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject


Re: OnPlayerModelSelection problem - Tadas - 05.04.2014

Quote:
Originally Posted by Lidor124
Посмотреть сообщение
Maybe becasue you don't have the full parameters?



https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject
Yes, I tryed that but when I get this error:
Код:
error 017: undefined symbol "index"



Re: OnPlayerModelSelection problem - Lidor124 - 05.04.2014

Quote:
Originally Posted by Tadas
Посмотреть сообщение
Yes, I tryed that but when I get this error:
Код:
error 017: undefined symbol "index"
Why haven't you read the wiki? it explain every parameter

Quote from there:
index The index (slot) to assign the object to (0-9 since 0.3d, 0-4 in previous versions).

Just put the slot you want for exmaple 1.


Re: OnPlayerModelSelection problem - RoboN1X - 05.04.2014

You can't just use playerid and modelid, you need to specify the slot (as mentioned by Lidor124) also Bone (click here for a list), it's required for that function, example:
Attaching "effect" (if i'm not wrong, that is for "daiktai") from object model selection to a player's head in slot 0 will be:
pawn Код:
SetPlayerAttachedObject(playerid, 0, modelid, 2);
Note that the position, rotation will be using default value 0, and scale will be 1. Otherwise it will be attached on specified value.