Create Object
#1

Hello,

I have a question about creating an object behind a player.

I've seen a few stocks, which calculate the position behind a player, but how can I create an object on this position.

Any help would be appreciated,
Reply
#2

The answer is in your topic's title.
Reply
#3

EXAMPLE:

CreateObject(3453, 40.427525, 1510.745483, 14.324432, 0.0000, 0.0000, 0.0000);

goes OnGameModeInit , or OnFilterScriptInit.
Reply
#4

Quote:
Originally Posted by $/Br(iayan||-l+[b|g
)/$ ]
EXAMPLE:

CreateObject(3453, 40.427525, 1510.745483, 14.324432, 0.0000, 0.0000, 0.0000);

goes OnGameModeInit , or OnFilterScriptInit.
Let me explain you a tiny bit more..

I want to create an object BEHIND a player

Like if you walk somewhere, type /bomb, you SPAWN a OBJECT, BEHIND a player.

How is this possible?
Reply
#5

Quote:
Originally Posted by MadeMan
The answer is in your topic's title.
This post was completely useless =')
Reply
#6

You said you already have the position and now you want to create the object.

Well my answer is CreateObject.

https://sampwiki.blast.hk/wiki/CreateObject
Reply
#7

pawn Код:
new Float:x,Float:y,Float:z,Float:a,Float:X,Float:y;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
X = x + (-2 * floatsin(-a,degrees));
Y = y + (-2 * floatcos(-a,degrees));
CreateObject(16442,X,Y,z,0,0,0); // Creates a cow 2 foot behind you (16442 = cow ID)
Creates it two foot behind him.


Quote:
Originally Posted by MadeMan
You said you already have the position and now you want to create the object.

Well my answer is CreateObject.

https://sampwiki.blast.hk/wiki/CreateObject
He said he wanted it to spawn it behind him.

Reply
#8

Quote:
Originally Posted by Hiddos
pawn Код:
new Float:x,Float:y,Float:z,Float:a,Float:X,Float:y;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
X = x + (-2 * floatsin(-a,degrees));
Y = y + (-2 * floatcos(-a,degrees));
CreateObject(16442,X,Y,z,0,0,0); // Creates a cow 2 foot behind you (16442 = cow ID)
Creates it two foot behind him.
You're the man, thanks alot for helping me out there
Reply
#9

Quote:
Originally Posted by Ţأ$jΰв٭Y ★
Quote:
Originally Posted by Hiddos
pawn Код:
new Float:x,Float:y,Float:z,Float:a,Float:X,Float:y;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
X = x + (-2 * floatsin(-a,degrees));
Y = y + (-2 * floatcos(-a,degrees));
CreateObject(16442,X,Y,z,0,0,0); // Creates a cow 2 foot behind you (16442 = cow ID)
Creates it two foot behind him.
You're the man, thanks alot for helping me out there
I actually got it from my own script, in which I use this to create explosions in-front of RC Tigers (tanks).

Enjoy it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)