help needed with mapandreas
#1

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
Reply
#2

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;
}
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)