SA-MP Forums Archive
CreateDynamicObject - 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: CreateDynamicObject (/showthread.php?tid=343540)



CreateDynamicObject - Twisted_Insane - 17.05.2012

Alright, I'm startin' now to use the streamer plugin by Incognito, and am gettin' a tagmismatch:

pawn Код:
CreateDynamicObject(2780, 2465.7588,-1690.2830,13.5115, -1, -1, -1, 100.0);
It's under "OnGameModeInit"! What's wrong?


Re: CreateDynamicObject - ViniBorn - 17.05.2012

Replace
pawn Код:
CreateDynamicObject(2780, 2465.7588,-1690.2830,13.5115, 0.0, 0.0, 0.0, 100.0);



Re: CreateDynamicObject - Twisted_Insane - 17.05.2012

Unfortunately the same errors appears with the followin' line:

pawn Код:
CreateDynamicObject(2780, 2465.7588,-1690.2830,13.5115, 0.0, 0.0, 0.0, 100.0);



Re: CreateDynamicObject - ViniBorn - 17.05.2012

Sorry. Now works...
pawn Код:
CreateDynamicObject(2780, 2465.7588,-1690.2830,13.5115, 0.0, 0.0, 0.0, 100);



Re: CreateDynamicObject - Twisted_Insane - 17.05.2012

No errors so far, but the object doesn't appear at the place where I've taken the co-ordinates!


Re: CreateDynamicObject - ViniBorn - 17.05.2012

The last parameters is the VirtualWorld ...

Change it

pawn Код:
//CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0);

CreateDynamicObject(2780, 2465.7588,-1690.2830,13.5115, 0.0, 0.0, 0.0, 100);
//To
CreateDynamicObject(2780, 2465.7588,-1690.2830,13.5115, 0.0, 0.0, 0.0, 0);



Re: CreateDynamicObject - ReneG - 17.05.2012

Just look at the Streamer Plugin page, and make sure your CreateObject code matches the parameters.


Re: CreateDynamicObject - Twisted_Insane - 17.05.2012

Alright, here's the next problem;

This command should attach a hat to the player:

pawn Код:
CMD:hat(playerid, params[])
{
    //if(!IsPlayerVip(playerid)) return SendClientMessage(playerid, red, "You need to be a VIP to use this command!");
    new myobject;
    myobject = CreateObject(18964, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    AttachObjectToPlayer(myobject, playerid, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
    return 1;
}
But, what shall be the co-ordinates for "AttachObjectToPlayer" now so the hat will be on the hat? And from where can I get the body co-ordinates?


Re: CreateDynamicObject - ViniBorn - 17.05.2012

You can use this
http://forum.sa-mp.com/showthread.ph...ObjectToPlayer


Re: CreateDynamicObject - MP2 - 17.05.2012

If you type a function and the opening parenthesis ( in pawno, a box will popup showing you the expected parameters.

So type

CreateDynamicObject(

in pawno and wait a second.


Re: CreateDynamicObject - [KHK]Khalid - 18.05.2012

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Alright, here's the next problem;

This command should attach a hat to the player:

pawn Код:
CMD:hat(playerid, params[])
{
    //if(!IsPlayerVip(playerid)) return SendClientMessage(playerid, red, "You need to be a VIP to use this command!");
    new myobject;
    myobject = CreateObject(18964, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    AttachObjectToPlayer(myobject, playerid, 0.0, 0.0, 0.0, 0.0, 0.0, 0);
    return 1;
}
But, what shall be the co-ordinates for "AttachObjectToPlayer" now so the hat will be on the hat? And from where can I get the body co-ordinates?
You can use https://sampwiki.blast.hk/wiki/GetPlayerPos. I also recommend you to use https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject instead of AttachObjectToPlayer.


Re: CreateDynamicObject - MP2 - 18.05.2012

You don't need GetPlayerPos for attaching objects. The coordinates in AttachObjectToPlayer and SetPlayerAttachedObject are OFFSETS. If they are all 0, the object is attached at the exact position of the bone/player.

You should use SetPlayerAttachedObject for this and attach it to the head. Use the new EditAttachedObject to get coordinates.