Spawning inside roadblock
#1

Yeah.. kind of annoying really.

Quote:

if(strcmp(cmdtext, "/rb", true)==0)
{
if(gTeam[playerid] != 2) return SendClientMessage(playerid, COLOR_RED,"/");
if (RoadBlock[playerid] == 1) return SendClientMessage(playerid, COLOR_RED,"/");
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
roadblock = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
SetPlayerPos(playerid, X, Y, Z+4)
RoadBlock[playerid] += 1;
SendClientMessage(playerid, COLOR_GREEN, "RoadBlock successfully deployed!");
return 1;
}
}

Any help?
Reply
#2

If i'm thinking correctly put a +50 infront of "Y" like i said i can't completely remember how that works
Reply
#3

How bigs the object?

Try increasing / decreasing the x and y positions till there next to it.

Example: SetPlayerPos(playerid, X+5, Y+5, Z+4);
Reply
#4

Код:
SetPlayerPos(playerid,X-2*floatsin(-A,degrees),Y-2*floatcos(-A,degrees),Z+0.2);
Reply
#5

Quote:
Originally Posted by Babul
Код:
SetPlayerPos(playerid,X-2*floatsin(-A,degrees),Y-2*floatcos(-A,degrees),Z+0.2);
This one works, thanks.
Anyone know what I can do to successfully delete 2 roadblocks? They can allow 2 to be spawned, but only 1 deleted.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)