17.07.2011, 07:30
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:
Here's the stock for CreateStrip:
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);
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;
}