OnPlayerModelSelection problem
#1

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 ?
Reply
#2

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
Reply
#3

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"
Reply
#4

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.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)