@sseebbyy - Used your code base with some changes and now I got working jetpack,but for some seconds. It was fun.
[SA Style] Re: Parachuting System
« Reply #15, on February 26th, 2017, 01:56 PM »Last edited on February 26th, 2017, 01:58 PM
Update
Changelog:
- made parachute be colorable (in 2 colors)
- changed animation ID when player "detaches" parachute - to avoid a bug
- made parachute spawn in random colors by start
First post was updated with new download link + some code edits.
Also, to make it truly random, add a srand( GetTickCount() ); to it.
But now may be the moment. How exactly should I use that srand( GetTickCount() ) ?
.
add local ParachuteWorldID = 0; // the vehicle WorldID of the parachute
Change
if( player.Weapon == 100) Announce( "Open your parachute!", player, 1 );
to
if( player.Weapon == wepParaID) Announce( "Open your parachute!", player, 1 );
Change
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == 100) && (g_PlayerFallAccum[player.ID] != 0) )
to
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == wepParaID) && (g_PlayerFallAccum[player.ID] != 0) )
Change
plrParachute[player.ID] = CreateVehicle( 6400, 0, player.Pos, 0, 0, 0 );
to
plrParachute[player.ID] = CreateVehicle( vehParaID, 0, player.Pos, 0, 0, 0 );
Bro I've tried this great
Suggestion to these changesCode: [Select] add local ParachuteWorldID = 0; // the vehicle WorldID of the parachute
Change
if( player.Weapon == 100) Announce( "Open your parachute!", player, 1 );
to
if( player.Weapon == wepParaID) Announce( "Open your parachute!", player, 1 );
Change
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == 100) && (g_PlayerFallAccum[player.ID] != 0) )
to
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == wepParaID) && (g_PlayerFallAccum[player.ID] != 0) )
Change
plrParachute[player.ID] = CreateVehicle( 6400, 0, player.Pos, 0, 0, 0 );
to
plrParachute[player.ID] = CreateVehicle( vehParaID, 0, player.Pos, 0, 0, 0 );
I suggest those changes because I thought it did not work because I changed wepParaID = 100; To the correct id on my server and as there were functions like if (player.Weapon == 100) Announce ("Open your parachute!", Player, 1); I did not work but now
You're not doing anything, it's the same thing, for me it's always worked like thisQuote from Luis_Labarca on April 19th, 2017, 06:24 PM Bro I've tried this great
Suggestion to these changesCode: [Select] add local ParachuteWorldID = 0; // the vehicle WorldID of the parachute
Change
if( player.Weapon == 100) Announce( "Open your parachute!", player, 1 );
to
if( player.Weapon == wepParaID) Announce( "Open your parachute!", player, 1 );
Change
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == 100) && (g_PlayerFallAccum[player.ID] != 0) )
to
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == wepParaID) && (g_PlayerFallAccum[player.ID] != 0) )
Change
plrParachute[player.ID] = CreateVehicle( 6400, 0, player.Pos, 0, 0, 0 );
to
plrParachute[player.ID] = CreateVehicle( vehParaID, 0, player.Pos, 0, 0, 0 );
I suggest those changes because I thought it did not work because I changed wepParaID = 100; To the correct id on my server and as there were functions like if (player.Weapon == 100) Announce ("Open your parachute!", Player, 1); I did not work but now
My suggestion is not for you :PQuote from kennedyarz on April 19th, 2017, 11:02 PM You're not doing anything, it's the same thing, for me it's always worked like thisQuote from Luis_Labarca on April 19th, 2017, 06:24 PM Bro I've tried this great
Suggestion to these changesCode: [Select] add local ParachuteWorldID = 0; // the vehicle WorldID of the parachute
Change
if( player.Weapon == 100) Announce( "Open your parachute!", player, 1 );
to
if( player.Weapon == wepParaID) Announce( "Open your parachute!", player, 1 );
Change
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == 100) && (g_PlayerFallAccum[player.ID] != 0) )
to
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == wepParaID) && (g_PlayerFallAccum[player.ID] != 0) )
Change
plrParachute[player.ID] = CreateVehicle( 6400, 0, player.Pos, 0, 0, 0 );
to
plrParachute[player.ID] = CreateVehicle( vehParaID, 0, player.Pos, 0, 0, 0 );
I suggest those changes because I thought it did not work because I changed wepParaID = 100; To the correct id on my server and as there were functions like if (player.Weapon == 100) Announce ("Open your parachute!", Player, 1); I did not work but now
if( !sucess ) tryAgain();
He only gave his opinion.Quote from Luis_Labarca on April 20th, 2017, 02:24 AM My suggestion is not for you :PQuote from kennedyarz on April 19th, 2017, 11:02 PM You're not doing anything, it's the same thing, for me it's always worked like thisQuote from Luis_Labarca on April 19th, 2017, 06:24 PM Bro I've tried this great
Suggestion to these changesCode: [Select] add local ParachuteWorldID = 0; // the vehicle WorldID of the parachute
Change
if( player.Weapon == 100) Announce( "Open your parachute!", player, 1 );
to
if( player.Weapon == wepParaID) Announce( "Open your parachute!", player, 1 );
Change
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == 100) && (g_PlayerFallAccum[player.ID] != 0) )
to
if( ( newKey == KEY_ONFOOT_FIRE ) && ( !player.Vehicle ) && (player.Weapon == wepParaID) && (g_PlayerFallAccum[player.ID] != 0) )
Change
plrParachute[player.ID] = CreateVehicle( 6400, 0, player.Pos, 0, 0, 0 );
to
plrParachute[player.ID] = CreateVehicle( vehParaID, 0, player.Pos, 0, 0, 0 );
I suggest those changes because I thought it did not work because I changed wepParaID = 100; To the correct id on my server and as there were functions like if (player.Weapon == 100) Announce ("Open your parachute!", Player, 1); I did not work but now
And he was right.