Yeah, sure, but keep in mind that the current system you have would only spawn 1 balloon at a time, and if another player spawns a balloon (by typing the command) and you just happen to be flying in one, it would get destroyed and you will drop.
PHP код:
new
pBaloonObj[MAX_PLAYERS][3] // 0 - Baloon, 1 - Fire1, 2 - Fire2
;
CMD:balloon(playerid,params[])
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
if (PlayerIn[playerid][BalloonPlayer])
{
if (IsValidObject(pBaloonObj[playerid][0]))
{
DestroyObject(pBaloonObj[playerid][0]);
DestroyObject(pBaloonObj[playerid][1]);
DestroyObject(pBaloonObj[playerid][2]);
}
PlayerIn[playerid][BalloonPlayer] = 0;
}
// Spawn the balloon 2.0 m further away in the direction the player is looking at
x += 2.0 * floatsin(-a, degrees);
y += 2.0 * floatcos(-a, degrees);
pBaloonObj[playerid][0] = CreateObject(19335, x, y, z, 0.0, 0.0, 0.0);
pBaloonObj[playerid][1] = CreateObject(18692, 0.0, 0,0, 0.0, 0.0, 0.0);
pBaloonObj[playerid][2] = CreateObject(18692, 0.0, 0,0, 0.0, 0.0, 0.0);
AttachObjectToObject(pBaloonObj[playerid][1], Balloon, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 1);
AttachObjectToObject(pBaloonObj[playerid][2], Balloon, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0, 1);
SendClientMessage(playerid,GREEN,"Enter the following keys to control the hot air balloon");
SendClientMessage(playerid,GREEN,"Alt+Y (Move Balloon Up)");
SendClientMessage(playerid,GREEN,"Alt+N (Move Balloon Down)");
SendClientMessage(playerid,GREEN,"F+Y (Move Balloon Forward)");
SendClientMessage(playerid,GREEN,"F+N (Move Balloon Back)");
SendClientMessage(playerid,GREEN,"C+Y (Move Balloon Right)");
SendClientMessage(playerid,GREEN,"C+N (Move Balloon Left)");
PlayerIn[playerid][BalloonPlayer] = 1;
return 1;
}