CreateDynamicObject
#1

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

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

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);
Reply
#4

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

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

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);
Reply
#7

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 3 Guest(s)