SA-MP Forums Archive
Attach rock in hands - 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: Attach rock in hands (/showthread.php?tid=582994)



Attach rock in hands - Sn4ke2 - 24.07.2015

Hello all, how can i do this, to attach a stone on player hands, and then player can't do anything, like press C, ore fight, only walk like in video

https://*********/SSftwtanojM


Re: Attach rock in hands - davve95 - 24.07.2015

It's the carrying animation. Search for it in wiki.
You'll also need AttachObjectToPlayer.


You can use a filterscript to know where to place the stone and then get the coordinates (Don't know any good FS).

I don't know where the coordinates will output either to 100%.
But I've heard it's possible .


Re: Attach rock in hands - Sn4ke2 - 25.07.2015

Yeh, thats i don't know, what are the coord for the attach object, i don't know ..


Re: Attach rock in hands - trablon - 25.07.2015

PHP код:
   if(!strcmp(cmdtext"/redcone"true)) 
    { 
        
SetPlayerAttachedObject(playerid312386); 
        
SendClientMessage(playeridCOLOR_GREEN"You are holding a Redcone"); 
        return 
1
     } 



Re: Attach rock in hands - Sn4ke2 - 25.07.2015

Not work, i don't want to use SetPlayerAttachedObject


Re: Attach rock in hands - Beckett - 25.07.2015

Create yourself a quick editor, like this.

pawn Код:
CMD:spawnobject(playerid,params[])
{
    new obj = SetPlayerAttachedObject(playerid,0,model,puthandbone);
    EditPlayerObject(playerid,obj);
}
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)
    {
        printf("%f,%f,%f,%f,%f,%f,%f,%f,%f",fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
    }
    else
    {
        SendClientMessage(playerid,-1, "Attached object edition not saved.");
    }
    return 1;
}
Search the wiki for the bone ids and when you've done editing it click on that SAVE icon ingame you'll see the coordinates printed in your console, copy them and go to your SetPlayerAttachedObject, paste the coordinates there.