SA-MP Forums Archive
/deployspikes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /deployspikes (/showthread.php?tid=401031)



/deployspikes - hejsan123 - 21.12.2012

Hello!

I got a problem:
when you ram on this with car your wheels doesn't under influence on this
Can someone help me to fix it

Quote:

CMD:deployspikes(playerid, params[])
{
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
{
if(PlayerInfo[playerid][pRank] >= 3 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pRank] >= 1)
{
for(new i; i < sizeof(SpikeStrips); i++)
{
if(SpikeStrips[i][sX] == 0)
{
new
Float: f_TempAngle,
string[128];

GetPlayerPos(playerid, SpikeStrips[i][sX], SpikeStrips[i][sY], SpikeStrips[i][sZ]);
GetPlayerFacingAngle(playerid, f_TempAngle);
SpikeStrips[i][sObjectID] = CreateDynamicObject(2899, SpikeStrips[i][sX], SpikeStrips[i][sY], SpikeStrips[i][sZ]-0.8, 0.0, 0.0, f_TempAngle);
GetPlayer3DZone(playerid, SpikeStrips[i][sDeployedAt], MAX_ZONE_NAME);
SpikeStrips[i][sDeployedBy] = GetPlayerNameEx(playerid);
format(string,sizeof(string),"Spike ID: %d successfully created.", i);
SendClientMessageEx(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "HQ: A spike has been deployed by %s at %s.", GetPlayerNameEx(playerid), SpikeStrips[i][sDeployedAt]);
foreach(Player, x)
{
if(IsACop(x))
{
SendClientMessageEx(x, TEAM_BLUE_COLOR, string);
if (PlayerInfo[x][pRank] >= 3)
{
SendClientMessageEx(x, COLOR_YELLOW, "You can remove a spike by typing /destroyspikes.");
}
}
}
return 1;
}
}
SendClientMessageEx(playerid, COLOR_WHITE, "Unable to spawn more strips, limit is 5." );
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You must be rank 3 or higher!");
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a LEO!");
}
return 1;
}




Re: /deployspikes - DaRk_RaiN - 21.12.2012

If you mean tire popping put this under OnGameModeInIt
pawn Code:
EnableTirePopping(1);



Re: /deployspikes - hejsan123 - 21.12.2012

Quote:
Originally Posted by DaRk_RaiN
View Post
If you mean tire popping put this under OnGameModeInIt
pawn Code:
EnableTirePopping(1);
Yes, that's what i need. But where can i put it, i didnt understand


Re: /deployspikes - [D]ry[D]esert - 21.12.2012

Add this under OnGamemodeInit
for example
pawn Code:
public OnGameModeInit()
{
EnableTirePopping(1);
}



Re: /deployspikes - DaRk_RaiN - 21.12.2012

Search for OnGameModeInIt in your script then put this under it EnableTirePopping(1);
Would look something like this
pawn Code:
public OnGameModeInit()
{
 EnableTirePopping(1);
//The rest of your script.......



Re: /deployspikes - R9 - 02.01.2013

Quote:
Originally Posted by DaRk_RaiN
View Post
Search for OnGameModeInIt in your script then put this under it EnableTirePopping(1);
Would look something like this
pawn Code:
public OnGameModeInit()
{
 EnableTirePopping(1);
//The rest of your script.......
I did get same problem, but that didnt work.