Police Car Mine System v1.0 -
Faisal_khan - 29.04.2012
Police Car Mine System V 1.0
Hi SA-MP Community,
This is my third Filterscript. Hope you like it. So as the title says, Police Car Mine System, it is a FS for the police to drop a mine on the road. And if a vehicle steps on it except the police car, the mine will blow off! KABOOM!
Lets go for the explanation:
To drop a mine, a player must press Y key. Here is the code for it:
pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys == KEY_YES)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 597)
{
return 1;
}
else
{
new Float:plocx,Float:plocy,Float:plocz;
GetVehiclePos(vehicleid, plocx, plocy, plocz);
CreateMine(plocx,plocy,plocz);
}
}
return 1;
}
We created the mine with this:
pawn Code:
new Float:plocx,Float:plocy,Float:plocz;
GetVehiclePos(vehicleid, plocx, plocy, plocz);
CreateMine(plocx,plocy,plocz);
Now when a player steps on mine in an vehicle, he must experience an explosion of type 7. Here is how we did it using OnPlayerUpdate:
pawn Code:
public OnPlayerUpdate(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
for(new i = 0; i < sizeof(MineInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 1, MineInfo[i][mX], MineInfo[i][mY], MineInfo[i][mZ]))
{
if(MineInfo[i][mCreated])
{
if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 597)
{
return 1;
}
else
{
CreateExplosion(MineInfo[i][mX], MineInfo[i][mY], MineInfo[i][mZ], 7, 20.0);
DestroyObject(MineInfo[i][mObject]);
}
return 0;
}
}
}
}
return 1;
}
The CreateMine function is build like this:
pawn Code:
stock CreateMine(Float:x,Float:y,Float:z)
{
for(new i = 0; i < sizeof(MineInfo); i++)
{
if(MineInfo[i][mCreated] == 0)
{
MineInfo[i][mCreated]=1;
MineInfo[i][mX]=x;
MineInfo[i][mY]=y;
MineInfo[i][mZ]=z-0.7;
MineInfo[i][mObject] = CreateObject(364, x, y, z, 0, 0, 0);
return 1;
}
}
return 0;
}
Hope you got it.
Credits
Faisal_khan for scripting.
Soon gonna release v2.0 for this with new features.
Pastebin
Re : Police Car Mine System v1.0 -
BigBaws - 29.04.2012
Nice Scripte Keep it up bro with more reality +1
Re: Re : Police Car Mine System v1.0 -
Faisal_khan - 29.04.2012
Quote:
Originally Posted by BigBaws
Nice Scripte Keep it up bro with more reality +1
|
Thank you bro for the rep as well as your words.
Re: Police Car Mine System v1.0 -
[Dk]RoCk - 29.04.2012
Cool Work Bro .. Keep Up 100/100
Re: Police Car Mine System v1.0 -
System64 - 29.04.2012
hah, good idea and nice work 3
Re: Police Car Mine System v1.0 -
sscarface - 29.04.2012
Realy nice script,i like it i will try
Re: Police Car Mine System v1.0 -
Bruno Pereira - 30.04.2012
good work, but use the public OnPlayerUpdate can not be good idea ...
Re: Police Car Mine System v1.0 -
WarriorEd22 - 30.04.2012
Pretty unique I would say. Good job!
Re: Police Car Mine System v1.0 -
Faisal_khan - 30.04.2012
Quote:
Originally Posted by Bruno Pereira
good work, but use the public OnPlayerUpdate can not be good idea ...
|
Thank you for the suggestion I will update it in v2.0
Quote:
Originally Posted by WarriorEd22
Pretty unique I would say. Good job!
|
Quote:
Originally Posted by [Dk]RoCk
Cool Work Bro .. Keep Up 100/100 
|
Quote:
Originally Posted by System64
hah, good idea and nice work 3 
|
Quote:
Originally Posted by sscarface
Realy nice script,i like it i will try
|
Thank you all!
Re: Police Car Mine System v1.0 -
Faisal_khan - 30.04.2012
Guyz give me some suggestions for v2.0 which will be for 0.3e
Re: Police Car Mine System v1.0 -
Phyrunx - 30.04.2012
Cool Idea

And nice Script
Amazing!! Keep it up
Re: Police Car Mine System v1.0 -
Faisal_khan - 30.04.2012
Quote:
Originally Posted by Phyrunx
Cool Idea 
And nice Script
Amazing!! Keep it up
|
Thank you bro!
Re: Police Car Mine System v1.0 -
Ballu Miaa - 30.04.2012
For the next update. Add an optional int param as the type of mine. if 0 then it will be be Anti Vehicle. If it is 1 then if will Anti Vehicle as well as Anti Player. How about it?
Great work with this. Please add any other link. I cant download see source as idk why i cant access pastebin.com anymore.
Please use solidfiles or any other uploading site. Thanks [Rep+3]
Re: Police Car Mine System v1.0 -
Face9000 - 30.04.2012
Awesome work,finally something unique here.
Re: Police Car Mine System v1.0 -
Faisal_khan - 01.05.2012
Quote:
Originally Posted by Ballu Miaa
For the next update. Add an optional int param as the type of mine. if 0 then it will be be Anti Vehicle. If it is 1 then if will Anti Vehicle as well as Anti Player. How about it?
Great work with this. Please add any other link. I cant download see source as idk why i cant access pastebin.com anymore.
Please use solidfiles or any other uploading site. Thanks [Rep+3]
|
Updated, I added MediaFire link and I will do as u said in v2.0.
Quote:
Originally Posted by Logitech90
Awesome work,finally something unique here.
|
Thank you!
Re: Police Car Mine System v1.0 -
Ballu Miaa - 01.05.2012
Quote:
Originally Posted by Faisal_khan
Updated, I added MediaFire link and I will do as u said in v2.0.
|
Great brother. Thanks for updating the links for me

Will be waiting for v2
Re: Police Car Mine System v1.0 -
MichaelProPlayer - 01.05.2012
lol man why you always release your scripts i don't understand
They are sooo COOL scripts

Respuesta: Police Car Mine System v1.0 -
javi - 01.05.2012
lol, nice script
Nobody had thought to do this script
Re: Respuesta: Police Car Mine System v1.0 -
Faisal_khan - 01.05.2012
Quote:
Originally Posted by Ballu Miaa
Great brother. Thanks for updating the links for me  Will be waiting for v2
|
Welcome dude!
Quote:
Originally Posted by MichaelProPlayer
lol man why you always release your scripts i don't understand
They are sooo COOL scripts
 
|
Thank you but as you said me earlier I will think of it nice idea.
Quote:
Originally Posted by javi
lol, nice script
Nobody had thought to do this script
|
Thank you!
Re: Police Car Mine System v1.0 -
Arnold_Collins - 01.05.2012
Very Nice Work