Little Help +Rep
#5

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
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.

Here's how it should look like:
PHP код:
new
    
pBaloonObj[MAX_PLAYERS][3// 0 - Baloon, 1 - Fire1, 2 - Fire2
;
CMD:balloon(playerid,params[])
{
    new 
Float:xFloat:yFloat:zFloat:a;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playerida);
    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
    
+= 2.0 floatsin(-adegrees);
    
+= 2.0 floatcos(-adegrees);
    
pBaloonObj[playerid][0] = CreateObject(19335xyz0.00.00.0);
    
pBaloonObj[playerid][1] = CreateObject(186920.00,00.00.00.0);
    
pBaloonObj[playerid][2] = CreateObject(186920.00,00.00.00.0);
    
AttachObjectToObject(pBaloonObj[playerid][1], Balloon0.00.02.00.00.00.01);
    
AttachObjectToObject(pBaloonObj[playerid][2], Balloon0.00.04.00.00.00.01);
    
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;

+Rep
Reply


Messages In This Thread
Little Help +Rep - by Mouiz - 13.07.2015, 12:20
Re: Little Help +Rep - by Virtual1ty - 13.07.2015, 12:37
Re: Little Help +Rep - by Vicky69 - 13.07.2015, 12:38
Re: Little Help +Rep - by SoFahim - 13.07.2015, 12:39
Re: Little Help +Rep - by Mouiz - 13.07.2015, 12:40
Re: Little Help +Rep - by Mouiz - 13.07.2015, 12:55
Re: Little Help +Rep - by SoFahim - 13.07.2015, 13:02
Re: Little Help +Rep - by Virtual1ty - 13.07.2015, 13:20
Re: Little Help +Rep - by Mouiz - 13.07.2015, 13:22
Re: Little Help +Rep - by SoFahim - 13.07.2015, 13:26

Forum Jump:


Users browsing this thread: 5 Guest(s)