help needed with mapandreas - 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: help needed with mapandreas (
/showthread.php?tid=340026)
help needed with mapandreas -
speediekiller2 - 05.05.2012
hello,
how can i make a fs that if i in a plane and i pressed spacebar that there on the lowest z coordinates are an explosion like a bombing,
pls write a tut for me i don't understand mapandreas,
thnx for all your help,
speediekiller2
Re: help needed with mapandreas -
SuperViper - 05.05.2012
pawn Код:
IsPlayerInPlane(playerid)
{
switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
{
case 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513, 548, 425, 417, 487, 488, 497, 563, 447, 469: return 1;
}
return 0;
}
public OnGameModeInit()
{
MapAndreas_Init(1);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(IsPlayerInPlane(playerid))
{
new Float: playersPos[3];
GetPlayerPos(playerid, playersPos[0], playersPos[1], playersPos[2]);
MapAndreas_FindZ_For2DCoord(playersPos[0], playersPos[1], playersPos[2]);
CreateExplosion(playersPos[0], playersPos[1], playersPos[2], 6, 10.0);
}
}
}
return 1;
}
Re: help needed with mapandreas -
MP2 - 05.05.2012
If you want an explosion instantly you can just do this:
pawn Код:
new Float:x, Float:y, Float:z;
GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
MapAndreas_FindZ_For2DCoord(x, y, z);
CreateExplosion(x, y, z, type, radius);
but if you wanted, you can create a bomb object (not sure of the ID) and use MoveObject to make it move to the ground.