Quantcast

Jump to content

» «
Photo

[C#|Q] How To Not Activate A Mod When In Vehicle?

5 replies to this topic
Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#1

Posted 13 May 2014 - 02:14 PM

I Had Made A Mod In Which We Spawn A Helicopter...(My First Mod ^_^)

Now I Want To Know How To Disable The Hotkey When In Vehicle

 

Help Would Be Appriciated...

 


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#2

Posted 13 May 2014 - 03:29 PM

if (Game.LocalPlayer.Character.isInVehicle()) return;

 

that code will exit any method if you are in a vehicle, maybe there is a better way but u dont post your code so who knows what would be best


Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#3

Posted 13 May 2014 - 05:06 PM

I Had Made A Mod In Which We Spawn A Helicopter...(My First Mod ^_^)

Now I Want To Know How To Disable The Hotkey When In Vehicle

 

Help Would Be Appriciated...

 

 

What i do is this:

if (!Player.Character.isInVehicle()) // The ! in front of it means 'when not'
{
        // The code that u want when he is not i car
}
else 
{
        // The code that u want when he is in a car
}

Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#4

Posted 13 June 2014 - 02:59 AM

@ultra Nine nine - Its For Ya Too ^^


UltraNineNine
  • UltraNineNine

    Nothing Is Really Over Until The Moment You Stop Trying

  • Members
  • Joined: 13 Mar 2014
  • None

#5

Posted 13 June 2014 - 04:00 AM

@ultra Nine nine - Its For Ya Too ^^

I've already done that


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#6

Posted 13 June 2014 - 04:02 AM

:p





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users