Hitman C4
#3

Command:

pawn Код:
if( strcmp( cmdtext, "/plantbomb", true ) == 0 )
{
    if( PlayerInfo[ playerid ][ pBombs ] == 0 ) return SendClientMessage( playerid, COLOR_GRAD2, " You don't have any C4 Explosives !" );
    if( IsPlayerInAnyVehicle( playerid ) ) return SendClientMessage( playerid, COLOR_GRAD2, " You can't do that while in a vehicle !" );
    if( PlayerTied[ playerid ] != 0 || PlayerCuffed[ playerid ] != 0 || PlayerFrozen[ playerid ] != 0 ) return SendClientMessage(playerid, COLOR_GREY, " You can't do that at this time !" );
    new
        Float: Position[ 4 ]
    ;
    GetPlayerPos( playerid, Position[ 0 ], Position[ 1 ], Position[ 2 ] );
    GetPlayerFacingAngle( playerid, Position[ 3 ] );
    SetPVarFloat( playerid, "X", Position[ 0 ] );
    SetPVarFloat( playerid, "Y", Position[ 1 ] );
    SetPVarFloat( playerid, "Z", Position[ 2 ] );
    SetPVarFloat( playerid, "A", Position[ 3 ] );
    SetPVarInt( playerid, "pBomb", 1 );
    ApplyAnimation( playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0 );
    DestroyObject( BombID[ playerid ] );
    Pozicija[ 0 ] += ( 1 * floatsin( -A, degrees ) );
    Pozicija[ 1 ] += ( 1 * floatcos( -A, degrees ) );
    BombID[ playerid ] = CreateObject( 1654, Position[ 0 ], Position[ 1 ], Position[ 2 ] - 0.9, 0, 90, 0 );
    GivePlayerGun( playerid, 40 );
    PlayerInfo[ playerid ][ pBombs ] --;
    SendClientMessage( playerid, COLOR_LIGHTBLUE, "* You have placed the C4, the device is now armed." );
    return true;
}
and key checking:

pawn Код:
if( newkeys & YOUR KEY )
{
    if( GetPVarInt( playerid, "pBomb" ) == 1 )
    {
        SetPVarInt( playerid, "pBomb", 0 );
        CreateExplosion( playerid, GetPVarFloat( playerid, "X" ), GetPVarFloat( playerid, "Y" ), GetPVarFloat(playerid, "Z" ), 0, 10 );
        // and another shit you want...
    }
}
Reply


Messages In This Thread
Fixed. - by Ifreezesir - 11.03.2011, 19:32
Re: Hitman C4 - by [BKR]LUCAGRABACR - 12.03.2011, 00:35
Re: Hitman C4 - by Gh0sT_ - 12.03.2011, 00:46

Forum Jump:


Users browsing this thread: 2 Guest(s)