11.03.2011, 19:32
(
Последний раз редактировалось Ifreezesir; 28.05.2011 в 22:11.
)
Fixed.
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
SetPVarFloat(playerid, "C4x", x);
SetPVarFloat(playerid, "C4y", y);
SetPVarFloat(playerid, "C4z", z);
c4planted[playerid]=1;
new c4planted [MAX_PLAYERS];
{
if c4planted[playerid]=1;
CreateExplosion(playerid, GetPVarFloat(playerid, "C4x"), GetPVarFloat(playerid, "C4y"), GetPVarFloat(playerid, "C4z"), 0, 10);
return 1;
}
if c4planted[playerid]=0;
{
SendClientMessage(playerid, COLOR_GRAD2, "You don't have a c4 planted");
return 1;
}
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;
}
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...
}
}