Creating Spike Strips problem.
#1

So I have a /deployspikes command, everything works fine because I get the confirmation message that I've planted a Spike Strip, but it doesn't actually create and appear.

Here's the code when you do /deployspikes:
pawn Код:
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);
Here's the stock for CreateStrip:
pawn Код:
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;
}
Reply
#2

Use a streamer such as Incognito's Streamer Plugin, maybe it'll work then.

Linkylink
Reply
#3

Yeah, I'm using that.
Reply
#4

Use it in that stock too..

pawn Код:
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;
}
At least I recommend you to break the stock, or it may continue with the loop when you created the spike strip
Reply
#5

How do you use a plugin in a stock? ^_^
Reply
#6

Try the code I posted above, it may work now.
Reply
#7

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
Try the code I posted above, it may work now.
Oh yah didn't see that, I'll test it now, sec.

EDIT:

Nope.
Reply
#8

I guess you create it under the ground... Try removing that -0.7 from Z
Reply
#9

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
I guess you create it under the ground... Try removing that -0.7 from Z
Did, didn't change anything.
Reply
#10

Then I do not know anymore :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)