28.07.2010, 12:38
Hi there,
I got a little problem with my script.
When you drive over the spikestrip, your tires don't pop.
What's wrong?
I got a little problem with my script.
When you drive over the spikestrip, your tires don't pop.
What's wrong?
pawn Код:
if(strcmp(cmd, "/ss", true) == 0 || strcmp(cmd, "/spikestrip", true) == 0)
{
if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1)
{
if(RoadblockUsed[playerid] == 0)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
PlayerRoadblock[playerid] = CreateObject(2892, x, y, z-0.6, 0.0, 0.0, a+90.0);
SendClientMessage(playerid, COLOR_YELLOW,"Spike-strip has been created on this location.");
format(string, sizeof(string), "Officer %s: I have deployed a spike-strip, Over.", PlayerName[playerid]);
SendTeamMessage(TEAM_COP, COLOR_BLUE, string);
RoadblockUsed[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_RED,"You have already created a spike-strip, use /rss to delete it.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops team.");
}
return 1;
}
if(strcmp(cmd, "/rss", true) == 0 || strcmp(cmd, "/removespikestrip", true) == 0)
{
if(gTeam[playerid] == TEAM_COP && PlayerInfo[playerid][pRank] == 1)
{
if(RoadblockUsed[playerid] == 1)
{
DestroyObject(PlayerRoadblock[playerid]);
SendClientMessage(playerid, COLOR_YELLOW,"You have successfully removed your spike-strip.");
RoadblockUsed[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_RED,"You cannot remove your spike-strip because you don't have one.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops team.");
}
return 1;
}