[SA Style] Parachuting System (now colorable!)

jayant

  • Full Member
  • #MOMO-CS
  • Posts: 163
[SA Style] Re: Parachuting System
« Reply #15, on February 26th, 2017, 01:56 PM »Last edited on February 26th, 2017, 01:58 PM
@sseebbyy - Used your code base with some changes and now I got working jetpack,but for some seconds. It was fun.

Diego^

  • Jr. Member
  • LBR Member.
  • Posts: 89
Sorry for my bad English.

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,082
[SA Style] Re: Parachuting System (now colorable!)
« Reply #17, on March 4th, 2017, 10:22 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.


Luis_Labarca

  • Sr. Member
  • Hello :D
  • Posts: 310
[SA Style] Re: Parachuting System (now colorable!)
« Reply #18, on March 5th, 2017, 02:27 AM »
Quote from sseebbyy on March 4th, 2017, 10:22 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.

Cool friend :D

My server .::[Counter - Striker 1.6]::.
IP: 49.12.15.63:9998

KAKAN

  • Wiki Contributor
  • Posts: 3,343
[SA Style] Re: Parachuting System (now colorable!)
« Reply #19, on March 5th, 2017, 05:31 AM »
To note: onPlayerGameKeysChange doesn't work with secondary keys.
Random function can be updated to a better one. Also, to make it truly random, add a srand( GetTickCount() ); to it.
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,082
[SA Style] Re: Parachuting System (now colorable!)
« Reply #20, on March 5th, 2017, 03:50 PM »
Quote from KAKAN on March 5th, 2017, 05:31 AM
Also, to make it truly random, add a srand( GetTickCount() ); to it.
That's some really old code written by Gudio, but it was doing it's job.
Never thought of a better one, because I didn't really need one.

But now may be the moment. How exactly should I use that srand( GetTickCount() ) ?

DizzasTeR

  • VC:MP Beta Tester
  • Infinite loops defy infinity by overflowing memory
  • Posts: 1,153
[SA Style] Re: Parachuting System (now colorable!)
« Reply #21, on March 5th, 2017, 04:06 PM »
Quote from sseebbyy on March 5th, 2017, 03:50 PM
But now may be the moment. How exactly should I use that srand( GetTickCount() ) ?
The srand inserts a seed which is used by the rand function in its algorithm. In this case GetTickCount which is being changed every second. Making a seed with srand( GetTickCount() ) will set a unique seed everytime the script runs so it will generate a pure random number rather than a sequential default seed one.

Hope I you get it.

p.s: inb4 someone comes and says that's not what srand does in squirrel ;D cuz I forgot

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,082
[SA Style] Re: Parachuting System (now colorable!)
« Reply #22, on March 5th, 2017, 04:14 PM »Last edited on March 5th, 2017, 04:15 PM
Quote from Doom_Kill3R on March 5th, 2017, 04:06 PM
.
Oh, this is pretty cool. Thank you !



First post updated !

Now the parachute will get really random colors, thanks to @KAKAN 's suggestion.
  • Added srand( GetTickCount() ); in the top of the script.

Luis_Labarca

  • Sr. Member
  • Hello :D
  • Posts: 310
[SA Style] Re: Parachuting System (now colorable!)
« Reply #23, on April 19th, 2017, 06:24 PM »
Bro I've tried this great

Suggestion to these changes

Code: [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 server .::[Counter - Striker 1.6]::.
IP: 49.12.15.63:9998

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 334
[SA Style] Re: Parachuting System (now colorable!)
« Reply #24, on April 19th, 2017, 11:02 PM »
Quote from Luis_Labarca on April 19th, 2017, 06:24 PM
Bro I've tried this great

Suggestion to these changes

Code: [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 this

Luis_Labarca

  • Sr. Member
  • Hello :D
  • Posts: 310
[SA Style] Re: Parachuting System (now colorable!)
« Reply #25, on April 20th, 2017, 02:24 AM »
Quote from kennedyarz on April 19th, 2017, 11:02 PM
Quote from Luis_Labarca on April 19th, 2017, 06:24 PM
Bro I've tried this great

Suggestion to these changes

Code: [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 this
My suggestion is not for you :P
My server .::[Counter - Striker 1.6]::.
IP: 49.12.15.63:9998

MatheuS

  • Wiki Contributor
  • LBR | Co-Leader & Brasil Real RPG | Developer
  • Posts: 469
[SA Style] Re: Parachuting System (now colorable!)
« Reply #26, on April 20th, 2017, 02:58 AM »
Quote from Luis_Labarca on April 20th, 2017, 02:24 AM
Quote from kennedyarz on April 19th, 2017, 11:02 PM
Quote from Luis_Labarca on April 19th, 2017, 06:24 PM
Bro I've tried this great

Suggestion to these changes

Code: [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 this
My suggestion is not for you :P
He only gave his opinion.

And he was right.
Code: [Select]
if( !sucess ) tryAgain();

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 334
[SA Style] Re: Parachuting System (now colorable!)
« Reply #27, on April 20th, 2017, 03:25 AM »
Quote from MatheuS on April 20th, 2017, 02:58 AM
Quote from Luis_Labarca on April 20th, 2017, 02:24 AM
Quote from kennedyarz on April 19th, 2017, 11:02 PM
Quote from Luis_Labarca on April 19th, 2017, 06:24 PM
Bro I've tried this great

Suggestion to these changes

Code: [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 this
My suggestion is not for you :P
He only gave his opinion.

And he was right.
exact. Besides, I better shut up ...

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 1,082

vito

  • Sr. Member
  • Posts: 405
[SA Style] Re: Parachuting System (now colorable!)
« Reply #29, on April 21st, 2017, 10:24 AM »
Can you tell me where model taken from? I'm going to use it in my server so I need credits of model, thanks.