Two roadblock objects spawned into eachother
#1

Hi,

I need help with this code. I am trying to spawn two roadblocks into eachother, so the big holes will disappear. I did some tests and calculated they need to have an X-coord gap of 3.800 ... Now i made this code, but the problem is it's only working properly when the Z-rotation is 0.0. When that isn't the case, the two roadblocks will stand between eachother. Can someone help me edit this to make it work?

Код:
stock CreateRoadblock(Float:x, Float:y, Float:z, Float:a)
{
	CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
	return CreateDynamicObject(981, x-3.8000493752, y, z, 0.0, 0.0, a+180.0);
}
Greetz,
Danny
Reply
#2

If you want 2 roadblocks into eachother you can simply do this:

pawn Код:
stock CreateRoadblock(Float:x, Float:y, Float:z, Float:a)
{
    CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
    CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
}
Reply
#3

Quote:
Originally Posted by skaTim
Посмотреть сообщение
If you want 2 roadblocks into eachother you can simply do this:

pawn Код:
stock CreateRoadblock(Float:x, Float:y, Float:z, Float:a)
{
    CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
    CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
}
I'm sorry for my weird way of explaining this, but I want to spawn in in such a way the one roadblock is covering the holes of the other one.
Reply
#4

pawn Код:
stock CreateRoadblock(Float:x, Float:y, Float:z, Float:a)
{
    CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
    CreateDynamicObject(981, x-3.8000493752, y, z, 0.0, 0.0, a+180.0);
}
Maybe this?
Reply
#5

Quote:
Originally Posted by skaTim
Посмотреть сообщение
pawn Код:
stock CreateRoadblock(Float:x, Float:y, Float:z, Float:a)
{
    CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
    CreateDynamicObject(981, x-3.8000493752, y, z, 0.0, 0.0, a+180.0);
}
Maybe this?
How does the value you're returning changes the way of spawning?
This will give me a warning if i'm right.
Reply
#6

Bump, i need help with this, please.
Reply
#7

What's the warning you get when you try skaTim's code?
Reply
#8

Код:
C:\Users\Tol\Desktop\Maxlife International V3 9-12-11 [0.3d]\pawno\include\homemadeincludes/copsystem.inc(262) : warning 209: function "CreateRoadblock" should return a value
This one, because the function isn't returning any value.
Reply
#9

just add
pawn Код:
return 1;
under it?

pawn Код:
stock CreateRoadblock(Float:x, Float:y, Float:z, Float:a)
{
    CreateDynamicObject(981, x, y, z, 0.0, 0.0, a+180.0);
    CreateDynamicObject(981, x-3.8000493752, y, z, 0.0, 0.0, a+180.0);
    return 1;
}
Reply
#10

Quote:
Originally Posted by Threshold
Посмотреть сообщение
just add
pawn Код:
return 1;
under it?
Yes i know that, but it won't solve the actual problem, the roadblocks are still not spawned correctly.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)