25.09.2011, 04:39
it there a possible way i can make command for a car to added not sure what to put so player can do it any help
eg
/bullet
spawns a bullet
eg
/bullet
spawns a bullet
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
new car1[MAX_PLAYERS];
car1[playerid] = CreateVehicle(541,Float:x,Float:y,Float:z,100.0,1,1,10);
PutPlayerInVehicle(playerid,car1[playerid],0);
add this into your command
pawn Код:
|
// In top of your Script
new BULLET[ MAX_PLAYERS ];
// The Command
CMD:bullet( playerid )
{
new Float: Pos[ 4 ];
GetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
GetPlayerFacingAngle( playerid, Pos[ 3 ] );
if( BULLET[ playerid ] > 0 )
{
if( GetPlayerVehicleID( playerid ) == BULLET[ playerid ] ) return SendClientMessage( playerid, info, "You are already sitting on your personal {FFFFFF}Bullet{4077F7}!" );
if( IsPlayerInAnyVehicle( playerid ) ) RemovePlayerFromVehicle( playerid );
LinkVehicleToInterior( BULLET[ playerid ], GetPlayerInterior( playerid ) );
SetVehicleVirtualWorld( BULLET[ playerid ], GetPlayerVirtualWorld( playerid ) );
PutPlayerInVehicle( playerid, BULLET[ playerid ], 0 );
SetVehiclePos( BULLET[ playerid ], Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
SetVehicleZAngle( BULLET[ playerid ], Pos[ 3 ] );
SendClientMessage( playerid, info, "Personal {FFFFFF}Bullet {4077F7}called!" );
}
else
{
if( IsPlayerInAnyVehicle( playerid ) ) RemovePlayerFromVehicle( playerid );
BULLET[ playerid ] = CreateVehicle( 522, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ], Pos[ 3 ], 75, 3, 240 );
LinkVehicleToInterior( BULLET[ playerid ], GetPlayerInterior( playerid ) );
SetVehicleVirtualWorld( BULLET[ playerid ], GetPlayerVirtualWorld( playerid ) );
PutPlayerInVehicle( playerid, BULLET[ playerid ], 0 );
SendClientMessage( playerid, info, "Personal {FFFFFF}Bullet {4077F7}created!" );
foreach(Player, i)if( IsPlayerConnected( i ) && i != playerid ) SetVehicleParamsForPlayer( BULLET[ playerid ], i, 0, 1 );
}
return ( 1 );
}
DestroyVehicle( BULLET[ playerid ] );