new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid,plocx,plocy,plocz);
GetPlayerFacingAngle(playerid,ploca);
new location[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerFacingAngle(playerid, angle);
GetPlayerPos(playerid, x, y, z);
CreateStrip(x, y, z, angle);
format(string, sizeof(string), "HQ: %s %s has placed a spike strip at %s", GetPlayerRank(playerid),PlayerName(playerid), location);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
SendRadioMessage(2, TEAM_BLUE_COLOR, string);
SendRadioMessage(3, TEAM_BLUE_COLOR, string);
SendRadioMessage(5, TEAM_BLUE_COLOR, string);
ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,0,0,0,0,0); // Plant bomb
GetPlayerFacingAngle(playerid,ploca);
CreateStrip(plocx,plocy,plocz,ploca);
stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)
{
for(new i = 0; i < sizeof(SpikeInfo); i++)
{
if(SpikeInfo[i][sCreated] == 0)
{
SpikeInfo[i][sCreated]=1;
SpikeInfo[i][sX]=x;
SpikeInfo[i][sY]=y;
SpikeInfo[i][sZ]=z-0.7;
SpikeInfo[i][sObject] = CreateObject(2899, x, y, z-0.9, 0, 0, Angle-90);
return 1;
}
}
return 0;
}
stock CreateStrip(Float:x,Float:y,Float:z,Float:Angle)
{
for(new i = 0; i < sizeof(SpikeInfo); i++)
{
if(SpikeInfo[i][sCreated] == 0)
{
SpikeInfo[i][sCreated]=1;
SpikeInfo[i][sX]=x;
SpikeInfo[i][sY]=y;
SpikeInfo[i][sZ]=z-0.7;
SpikeInfo[i][sObject] = CreateDynamicObject(2899, x, y, z-0.9, 0, 0, Angle-90,-1,-1,-1,100.0);
break;
}
}
return 0;
}
I guess you create it under the ground... Try removing that -0.7 from Z
|