Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

[Q|C#|.NET] Why does IsControlJustPressed doesnt work as just pressed?


MrGTAmodsgerman
 Share

Recommended Posts

MrGTAmodsgerman

Hey,

I am trying to run a function that have different ways when i holding the vehicleexit key or just press the vehicleexit key.

For me it makes no difference when i even change

 IsControlPressed

to

IsControlJustPressed

.

I got this way from:

http://gtaforums.com/topic/848554-c-how-to-add-controller-support-to-your-mod/

But it doesnt help.

 

So what i have to do then? Do i need to add some special stuff?

I want to run it like the IVVehicleExit mod, but i dont know how he do it.

Can someone explain me that?

 

Thanks

Link to comment
Share on other sites

JohnMcDoogle

'is_control_just_pressed' returns true if the given control was pressed, and was now just released. So basically if you're looping this as a check, it will return true once you let go of the control.

 

'is_control_pressed' returns true if the given control is being held down during the time of is_control_pressed being called.

 

 

Not sure if this helps but I wanted just to make sure you understand what they both do. np

 

Edit: I looked at the thread you linked and I think you understand what the two natives do. I'm not sure what your problem is as I'm not familiar with C#.

Edited by JohnMcDoogle
  • Like 1
Link to comment
Share on other sites

Hey,

I am trying to run a function that have different ways when i holding the vehicleexit key or just press the vehicleexit key.

For me it makes no difference when i even change

 IsControlPressed

to

IsControlJustPressed

.

I got this way from:

http://gtaforums.com/topic/848554-c-how-to-add-controller-support-to-your-mod/

But it doesnt help.

 

So what i have to do then? Do i need to add some special stuff?

I want to run it like the IVVehicleExit mod, but i dont know how he do it.

Can someone explain me that?

 

Thanks

Is_Control_Just_pressed returns true the moment it was pressed and turns to false the next frame.

​Is_Control_pressed returns true when it is pressed, and doesn't turn false the next frame

 

The problem is Is_Control_Pressed returns true the first frame too, and therefore you are not seeing any difference. You can use a timer to skip the first few frames and you can also use this to determine how much time it has to be held.

  • Like 1
Link to comment
Share on other sites

MrGTAmodsgerman

 

Hey,

I am trying to run a function that have different ways when i holding the vehicleexit key or just press the vehicleexit key.

For me it makes no difference when i even change

 IsControlPressed

to

IsControlJustPressed

.

I got this way from:

http://gtaforums.com/topic/848554-c-how-to-add-controller-support-to-your-mod/

But it doesnt help.

 

So what i have to do then? Do i need to add some special stuff?

I want to run it like the IVVehicleExit mod, but i dont know how he do it.

Can someone explain me that?

 

Thanks

Is_Control_Just_pressed returns true the moment it was pressed and turns to false the next frame.

​Is_Control_pressed returns true when it is pressed, and doesn't turn false the next frame

 

The problem is Is_Control_Pressed returns true the first frame too, and therefore you are not seeing any difference. You can use a timer to skip the first few frames and you can also use this to determine how much time it has to be held.

 

I dont get it, its confusing! I try it with a timer, but it only works when i holding the key instantly and the player directly leave the car. But what i want is that when i holding the key inside my current vehicle that something happends. But when i just take a short press on the key, something different is going on. Can you give me a example that shows how it works perfectly?

Link to comment
Share on other sites

public int timer = 0;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {    \\Do whatever you want    }}

​Now, theoretically this should work. Try it out. Right now, hold the button for three seconds and it will do whatever you want to do in the if statement. This is a bad way of doing this, since your Tick is only run once per second, you can look into the Timer class to create your own timers for this kind of thing. Also, this is only a one time thing. Since there is no method to return it back to 0, you wont be able to use this another time. Ofc it will work, but it will work the moment you press it, not after three seconds. You can add a reset timer to reset it back to 0 once X amount of time has passed.

Edited by AHK1221
  • Like 1
Link to comment
Share on other sites

MrGTAmodsgerman
public int timer = 0;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {    \\Do whatever you want    }}

​Now, theoretically this should work. Try it out. Right now, hold the button for three seconds and it will do whatever you want to do in the if statement. This is a bad way of doing this, since your Tick is only run once per second, you can look into the Timer class to create your own timers for this kind of thing. Also, this is only a one time thing. Since there is no method to return it back to 0, you wont be able to use this another time. Ofc it will work, but it will work the moment you press it, not after three seconds. You can add a reset timer to reset it back to 0 once X amount of time has passed.

 

Um, but what about the key that directly runs the function? Doesnt it need a

    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;        if(timer <= 3000)    }

? Because the same happend in a different way and it have to stop the other way you know?!

And what do you mean with

you can look into the Timer class to create your own timers

you can look into the Timer class to create your own timers

Which Timer class? What are you talking about? NativeDB?

Anyways thank you.

But how to reset the timer?

I cant find anything like that, reset isnt declared! Or do you mean to declare "reset" as "0"?

Link to comment
Share on other sites

 

public int timer = 0;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {    \\Do whatever you want    }}

​Now, theoretically this should work. Try it out. Right now, hold the button for three seconds and it will do whatever you want to do in the if statement. This is a bad way of doing this, since your Tick is only run once per second, you can look into the Timer class to create your own timers for this kind of thing. Also, this is only a one time thing. Since there is no method to return it back to 0, you wont be able to use this another time. Ofc it will work, but it will work the moment you press it, not after three seconds. You can add a reset timer to reset it back to 0 once X amount of time has passed.

 

Um, but what about the key that directly runs the function? Doesnt it need a

    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;        if(timer <= 3000)    }

? Because the same happend in a different way and it have to stop the other way you know?!

And what do you mean with

you can look into the Timer class to create your own timers

you can look into the Timer class to create your own timers

Which Timer class? What are you talking about? NativeDB?

Anyways thank you.

But how to reset the timer?

I cant find anything like that, reset isnt declared! Or do you mean to declare "reset" as "0"?

 

 

It doesn't matter, if the if statement is in it or out since it will activate when timer reaches a certain point and it only reaches that point in the Key if statement. Also it is

if(timer >= 3000)

not

if(timer <= 3000)

Timer class:

https://msdn.microsoft.com/en-us/library/system.windows.forms.timer(v=vs.110).aspx

 

for resetting:​

public int timer = 0;public int resetTime = 3000;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {        \\Do whatever you want        resetTime -= this.Interval;    }    if(resetTime <= 0)    {        timer = 0;        resetTime = 3000;​    }}

​this code resets the timer 3 seconds after it has been held. As I said before, this isn't the most proper way, so use the above link to create another Tick event used specifically for this purpose. There are some bugs, like for example you only held it half way so timer fills up until 2000. It doesn't reset at that. But I hope you can fix these.

Edited by AHK1221
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
MrGTAmodsgerman

 

 

public int timer = 0;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {    \\Do whatever you want    }}

​Now, theoretically this should work. Try it out. Right now, hold the button for three seconds and it will do whatever you want to do in the if statement. This is a bad way of doing this, since your Tick is only run once per second, you can look into the Timer class to create your own timers for this kind of thing. Also, this is only a one time thing. Since there is no method to return it back to 0, you wont be able to use this another time. Ofc it will work, but it will work the moment you press it, not after three seconds. You can add a reset timer to reset it back to 0 once X amount of time has passed.

 

Um, but what about the key that directly runs the function? Doesnt it need a

    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;        if(timer <= 3000)    }

? Because the same happend in a different way and it have to stop the other way you know?!

And what do you mean with

you can look into the Timer class to create your own timers

you can look into the Timer class to create your own timers

Which Timer class? What are you talking about? NativeDB?

Anyways thank you.

But how to reset the timer?

I cant find anything like that, reset isnt declared! Or do you mean to declare "reset" as "0"?

 

 

It doesn't matter, if the if statement is in it or out since it will activate when timer reaches a certain point and it only reaches that point in the Key if statement. Also it is

if(timer >= 3000)

not

if(timer <= 3000)

Timer class:

https://msdn.microsoft.com/en-us/library/system.windows.forms.timer(v=vs.110).aspx

 

for resetting:​

public int timer = 0;public int resetTime = 3000;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {        \\Do whatever you want        resetTime -= this.Interval;    }    if(resetTime <= 0)    {        timer = 0;        resetTime = 3000;​    }}

​this code resets the timer 3 seconds after it has been held. As I said before, this isn't the most proper way, so use the above link to create another Tick event used specifically for this purpose. There are some bugs, like for example you only held it half way so timer fills up until 2000. It doesn't reset at that. But I hope you can fix these.

 

Thanks, but it doesnt really work, its working like holding 3 seconds, and the short press function run, and next time the long pressing function run!??

What about this example? https://libertylocked.wordpress.com/2015/06/19/readability-is-priority-for-example-scripts/

Its completly different but it doesnt work for me because

&&

isnt declared. I dont know what it means,

and your link doesnt help me because i dont see where it was made and what i need. Sorry, i am not the best scripter

Link to comment
Share on other sites

Well... you have to wait three seconds before you use it again. Also remember to hold it for three seconds. I have no idea about the link you posted to me. Um, in the link I provided, the namespace and assembly are provided. The link was meant to tell you how to have custom Tick events btw. You can edit my code so it is bug free, and you can reduce the time. But I dont really have the time to do it myself, I hope you figure it out.

  • Like 1
Link to comment
Share on other sites

MrGTAmodsgerman

Well... you have to wait three seconds before you use it again. Also remember to hold it for three seconds. I have no idea about the link you posted to me. Um, in the link I provided, the namespace and assembly are provided. The link was meant to tell you how to have custom Tick events btw. You can edit my code so it is bug free, and you can reduce the time. But I dont really have the time to do it myself, I hope you figure it out.

What i mean was, it doesnt give me a short press option, the function i want to run at short press is running after i hold the 3 seconds. But the function that i was trying to run on holding the key also runs after 3 seconds. Its changeing everytime! So the code of you link was made from you? Because i used you code from this here above (not the link) and yea, its still doesnt really work. I really want to get this code you post here start working, because i can understand it then how it works. Currently i really dont get it how it works, or much better to say, i dont know whats wrong with your code and how its work.

is something else here that can give me more options? Someone that understand that exit script example of my link that i post here?

 

 

Thanks

Edited by MrGTAmodsgerman
Link to comment
Share on other sites

 

 

 

 

public int timer = 0;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {    \\Do whatever you want    }}

​Now, theoretically this should work. Try it out. Right now, hold the button for three seconds and it will do whatever you want to do in the if statement. This is a bad way of doing this, since your Tick is only run once per second, you can look into the Timer class to create your own timers for this kind of thing. Also, this is only a one time thing. Since there is no method to return it back to 0, you wont be able to use this another time. Ofc it will work, but it will work the moment you press it, not after three seconds. You can add a reset timer to reset it back to 0 once X amount of time has passed.

 

Um, but what about the key that directly runs the function? Doesnt it need a

    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;        if(timer <= 3000)    }

? Because the same happend in a different way and it have to stop the other way you know?!

And what do you mean with

you can look into the Timer class to create your own timers

you can look into the Timer class to create your own timers

Which Timer class? What are you talking about? NativeDB?

Anyways thank you.

But how to reset the timer?

I cant find anything like that, reset isnt declared! Or do you mean to declare "reset" as "0"?

 

 

It doesn't matter, if the if statement is in it or out since it will activate when timer reaches a certain point and it only reaches that point in the Key if statement. Also it is

if(timer >= 3000)

not

if(timer <= 3000)

Timer class:

https://msdn.microsoft.com/en-us/library/system.windows.forms.timer(v=vs.110).aspx

 

for resetting:​

public int timer = 0;public int resetTime = 3000;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {        \\Do whatever you want        resetTime -= this.Interval;    }    if(resetTime <= 0)    {        timer = 0;        resetTime = 3000;​    }}

​this code resets the timer 3 seconds after it has been held. As I said before, this isn't the most proper way, so use the above link to create another Tick event used specifically for this purpose. There are some bugs, like for example you only held it half way so timer fills up until 2000. It doesn't reset at that. But I hope you can fix these.

 

Thanks, but it doesnt really work, its working like holding 3 seconds, and the short press function run, and next time the long pressing function run!??

What about this example? https://libertylocked.wordpress.com/2015/06/19/readability-is-priority-for-example-scripts/

Its completly different but it doesnt work for me because

 

&&

isnt declared. I dont know what it means,

and your link doesnt help me because i dont see where it was made and what i need. Sorry, i am not the best scripter

 

 

It's actually a syntax fail. It's probably his code highlighter that failed to write the & symbol correctly.

 

The original author wanted to write this symbol && which is an operator that means "AND" in C#.

So here's the line you must correct if you are using his script :

        if (player.IsAlive && player.IsInVehicle()) // Replaced && with &&
Edited by ins1de
  • Like 1
Link to comment
Share on other sites

 

Well... you have to wait three seconds before you use it again. Also remember to hold it for three seconds. I have no idea about the link you posted to me. Um, in the link I provided, the namespace and assembly are provided. The link was meant to tell you how to have custom Tick events btw. You can edit my code so it is bug free, and you can reduce the time. But I dont really have the time to do it myself, I hope you figure it out.

What i mean was, it doesnt give me a short press option, the function i want to run at short press is running after i hold the 3 seconds. But the function that i was trying to run on holding the key also runs after 3 seconds. Its changeing everytime! So the code of you link was made from you? Because i used you code from this here above (not the link) and yea, its still doesnt really work. I really want to get this code you post here start working, because i can understand it then how it works. Currently i really dont get it how it works, or much better to say, i dont know whats wrong with your code and how its work.

is something else here that can give me more options? Someone that understand that exit script example of my link that i post here?

 

 

Thanks

 

Revised code:

 

public int timer = 0;public int resetTime = 3000;public yourClassName(){    Interval = 1000;    Tick += onTick;    KeyDown += onKeyDown;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {        \\Do whatever you want         \\Long press.        resetTime -= this.Interval;    }    if(resetTime <= 0)    {        timer = 0;        resetTime = 3000;​    }}public void onKeyDown(object sender, KeyEventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        //Short Press    }}
  • Like 1
Link to comment
Share on other sites

MrGTAmodsgerman

 

 

 

 

Well... you have to wait three seconds before you use it again. Also remember to hold it for three seconds. I have no idea about the link you posted to me. Um, in the link I provided, the namespace and assembly are provided. The link was meant to tell you how to have custom Tick events btw. You can edit my code so it is bug free, and you can reduce the time. But I dont really have the time to do it myself, I hope you figure it out.

What i mean was, it doesnt give me a short press option, the function i want to run at short press is running after i hold the 3 seconds. But the function that i was trying to run on holding the key also runs after 3 seconds. Its changeing everytime! So the code of you link was made from you? Because i used you code from this here above (not the link) and yea, its still doesnt really work. I really want to get this code you post here start working, because i can understand it then how it works. Currently i really dont get it how it works, or much better to say, i dont know whats wrong with your code and how its work.

is something else here that can give me more options? Someone that understand that exit script example of my link that i post here?

 

 

Thanks

 

Revised code:

public int timer = 0;public int resetTime = 3000;public yourClassName(){    Interval = 1000;    Tick += onTick;    KeyDown += onKeyDown;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {        \\Do whatever you want         \\Long press.        resetTime -= this.Interval;    }    if(resetTime <= 0)    {        timer = 0;        resetTime = 3000;​    }}public void onKeyDown(object sender, KeyEventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        //Short Press    }}

 

 

Thanks, it make much more sense now but for some stupid reason, onKeyDown doesnt work anymore! I already used it at my script but its acting like it isnt there now! I dont

know what it is

 

My code:

public class MyScriptName : Script{    public int timer = 0;    public int resetTime = 3000;    public MyScriptName()    {        Interval = 1000;        Tick += OnTick;        KeyDown += OnKeyDown;        //KeyUp += OnKeyUp;        Interval = 10;    }    void OnTick(object sender, EventArgs e)    {        if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))        {            timer += this.Interval;        }        if (timer >= 3000)        {            Game.Player.Character.SetDefaultClothes();            resetTime -= this.Interval;        }        if (resetTime <= 0)        {            timer = 0;            resetTime = 3000;        }    }    void OnKeyDown(object sender, KeyEventArgs e)    {        if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))        {            Game.Player.Character.RandomizeOutfit();        }    }}

And a another problem is that the long press key function doesnt run always when i hold the 3 seconds! Only sometimes!

 

 

 

 

 

 

 

 

public int timer = 0;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {    \\Do whatever you want    }}

​Now, theoretically this should work. Try it out. Right now, hold the button for three seconds and it will do whatever you want to do in the if statement. This is a bad way of doing this, since your Tick is only run once per second, you can look into the Timer class to create your own timers for this kind of thing. Also, this is only a one time thing. Since there is no method to return it back to 0, you wont be able to use this another time. Ofc it will work, but it will work the moment you press it, not after three seconds. You can add a reset timer to reset it back to 0 once X amount of time has passed.

 

Um, but what about the key that directly runs the function? Doesnt it need a

    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;        if(timer <= 3000)    }

? Because the same happend in a different way and it have to stop the other way you know?!

And what do you mean with

you can look into the Timer class to create your own timers

you can look into the Timer class to create your own timers

Which Timer class? What are you talking about? NativeDB?

Anyways thank you.

But how to reset the timer?

I cant find anything like that, reset isnt declared! Or do you mean to declare "reset" as "0"?

 

 

It doesn't matter, if the if statement is in it or out since it will activate when timer reaches a certain point and it only reaches that point in the Key if statement. Also it is

if(timer >= 3000)

not

if(timer <= 3000)

Timer class:

https://msdn.microsoft.com/en-us/library/system.windows.forms.timer(v=vs.110).aspx

for resetting:​

public int timer = 0;public int resetTime = 3000;public yourClassName(){    Interval = 1000;    Tick += onTick;}public void onTick(object sender, EventArgs e){    if (Game.IsControlPressed(2, GTA.Control.ScriptPadLeft))     {        timer += this.Interval;    }    if(timer >= 3000)    {        \\Do whatever you want        resetTime -= this.Interval;    }    if(resetTime <= 0)    {        timer = 0;        resetTime = 3000;​    }}

​this code resets the timer 3 seconds after it has been held. As I said before, this isn't the most proper way, so use the above link to create another Tick event used specifically for this purpose. There are some bugs, like for example you only held it half way so timer fills up until 2000. It doesn't reset at that. But I hope you can fix these.

 

Thanks, but it doesnt really work, its working like holding 3 seconds, and the short press function run, and next time the long pressing function run!??

What about this example? https://libertylocked.wordpress.com/2015/06/19/readability-is-priority-for-example-scripts/

Its completly different but it doesnt work for me because

 

&&

isnt declared. I dont know what it means,

and your link doesnt help me because i dont see where it was made and what i need. Sorry, i am not the best scripter

 

 

It's actually a syntax fail. It's probably his code highlighter that failed to write the & symbol correctly.

 

The original author wanted to write this symbol && which is an operator that means "AND" in C#.

So here's the line you must correct if you are using his script :

        if (player.IsAlive && player.IsInVehicle()) // Replaced && with &&

 

 

Thank you but where is amp declared and what does gt means?

if (holdTime >= _HOLD_THRESHOLD)
Edited by MrGTAmodsgerman
Link to comment
Share on other sites

Thank you but where is amp declared and what does gt means?

if (holdTime >= _HOLD_THRESHOLD)

 

& is not a variable, it has nothing to do with scripting. It is a problem with his website that shows it instead of an HTML symbol. :(

 

gt; is the same problem again. Here, take a look at the HTML entities if you don't see what I mean : https://dev.w3.org/html5/html-author/charref

 

Anyways, this is the code you need : http://pastebin.com/eMHDFHXy and he also made a second version, available here http://pastebin.com/a2HZeB8p

 

 

 

  • Like 1
Link to comment
Share on other sites

Of course it doesnt work, why did you set the Interval to ten in the instructor?

  • Like 1
Link to comment
Share on other sites

MrGTAmodsgerman

 

Thank you but where is amp declared and what does gt means?

if (holdTime >= _HOLD_THRESHOLD)

 

& is not a variable, it has nothing to do with scripting. It is a problem with his website that shows it instead of an HTML symbol. :(

 

gt; is the same problem again. Here, take a look at the HTML entities if you don't see what I mean : https://dev.w3.org/html5/html-author/charref

 

Anyways, this is the code you need : http://pastebin.com/eMHDFHXy and he also made a second version, available here http://pastebin.com/a2HZeB8p

 

 

 

 

Thank you! Now i thing i will get it to work with this example, but which script way is better? @AHK1221 one? Or just like the script example?

Of course it doesnt work, why did you set the Interval to ten in the instructor?

WOooPs! My fault! I just forgot it to remove it from my old script :panic:

Edited by MrGTAmodsgerman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.