14.04.2012, 13:00
(
Последний раз редактировалось Faisal_khan; 01.05.2012 в 08:57.
)
Bomber
Hi guyz this is my second filterscript. I think I did not pleased you all with my first [FilterScript] Moving Ship . So this one I made for you guyz think this may please you all. I made this in 1 day with simple function CreateExplosion() and a tricky function MapAndreas_FindZ_For2DCoord(). This is a plugin which is useful for finding the highest Z co-ordinate that is finding the exact Z cor-ordinate of the create where our explosion would be created. But you need to download this plugin. Here we go with the explanation:pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_HANDBRAKE)
{
if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 476)
{
return SendClientMessage(playerid, 0xFF0000AA, "");
}
else
{
new Float:VBPos[3];
GetVehiclePos(GetPlayerVehicleID(playerid),VBPos[0],VBPos[1],VBPos[2]);
MapAndreas_FindZ_For2DCoord(VBPos[0], VBPos[1], VBPos[2]);
CreateExplosion(VBPos[0], VBPos[1], VBPos[2], 7, 20.0);
SendClientMessage(playerid, 0xFF0000AA, "KABOOM!!");
}
return 1;
}
return 1;
}
First we need to find the Z co-ordinate here we got a function:
pawn Код:
MapAndreas_FindZ_For2DCoord(VBPos[0], VBPos[1], VBPos[2]);
Now its simple to create an explosion:
pawn Код:
CreateExplosion(VBPos[0], VBPos[1], VBPos[2], 7, 20.0);
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 476)
{
return SendClientMessage(playerid, 0xFF0000AA, "");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You entered in a Bomber plane press Space to drop big bomb.");
return 1;
}
}
Screenshots
Credits
Faisal_khan – For scripting all thing.
Kalcor aka Kye – For his awesome plugin MapAndreas [Plugin] MapAndreas plugin v1.0 beta.