Quantcast

Jump to content

» «
Photo

[C#] A problem with adding new blip.

4 replies to this topic
ES_SENCE
  • ES_SENCE

    Player Hater

  • Members
  • Joined: 4 weeks ago
  • South-Korea

#1

Posted 4 weeks ago

Hello, guys.

I'm new here and making modding with C#.

I want to add new blip but I don't know why it doesn't work.

Here are my example codes:

private List<Blip> blips = new List<Blip>();

blips.Add(World.CreateBlip(new Vector3(-80.7f, -1761.8f, 29.8f)));
blips[0].Sprite = BlipSprite.JerryCan;
blips[0].Color = BlipColor.White;
blips[0].Scale = 0.7f;
blips[0].Name = "Blip name";

That's it.

I've searched gtaforums but I couldn't get the solution.

If it's okay to you, please help me out of here.

Thank you for reading and have a great day.


LeeC2202
  • LeeC2202

    Snitch

  • Members
  • Joined: 24 Oct 2015
  • United-Kingdom

#2

Posted 4 weeks ago Edited by LeeC2202, 4 weeks ago.

Works fine for me

 

HAyT2p5.jpg

 

But here's the thing, you said "I want to add new blip but I don't know why it doesn't work."... that's it, that's pretty much all you said.

 

When you go to the doctor's, do you sit down and say "I'm not well" and then let them guess all the possible things that might be your illness, or do you describe what the problem is, where the problem is, what the symptoms are etc...?

 

I am genuinely curious as to what you thought we could possibly suggest as a solution, based on "it doesn't work", especially considering that it does in fact work. I could say "It's not a proper script" or "That piece of code on its own will never work" and both of those would be true. If I put that code into a .cs file and dropped it into the Scripts folder, nothing would happen. If I put it into a code file in Visual Studio, there would be errors all over the place... 62 errors to be precise. I dropped it into a working script and it worked with no problems.

 

The people who write scripts, who come on this forum, haven't got the time to ask question after question, to try and get some information. Just like a doctor won't sit there asking "Is it your leg? Is it your arm? Do you have a headache? Is anywhere bleeding?". So this type of question will generally get ignored... or it will generate a more than likely sarcastic response, because you are forcing people to make wild guesses as to what might not be working and nobody likes spending their time playing guessing games, when they could be writing code instead.

 

If you want people to diagnose your problem, then "it doesn't work" is just not enough... unless "it does work" is a good enough answer that is... because it does work, as you can see from the image.


ES_SENCE
  • ES_SENCE

    Player Hater

  • Members
  • Joined: 4 weeks ago
  • South-Korea

#3

Posted 4 weeks ago Edited by ES_SENCE, 4 weeks ago.

Works fine for me

 

HAyT2p5.jpg

 

But here's the thing, you said "I want to add new blip but I don't know why it doesn't work."... that's it, that's pretty much all you said.

 

When you go to the doctor's, do you sit down and say "I'm not well" and then let them guess all the possible things that might be your illness, or do you describe what the problem is, where the problem is, what the symptoms are etc...?

 

I am genuinely curious as to what you thought we could possibly suggest as a solution, based on "it doesn't work", especially considering that it does in fact work. I could say "It's not a proper script" or "That piece of code on its own will never work" and both of those would be true. If I put that code into a .cs file and dropped it into the Scripts folder, nothing would happen. If I put it into a code file in Visual Studio, there would be errors all over the place... 62 errors to be precise. I dropped it into a working script and it worked with no problems.

 

The people who write scripts, who come on this forum, haven't got the time to ask question after question, to try and get some information. Just like a doctor won't sit there asking "Is it your leg? Is it your arm? Do you have a headache? Is anywhere bleeding?". So this type of question will generally get ignored... or it will generate a more than likely sarcastic response, because you are forcing people to make wild guesses as to what might not be working and nobody likes spending their time playing guessing games, when they could be writing code instead.

 

If you want people to diagnose your problem, then "it doesn't work" is just not enough... unless "it does work" is a good enough answer that is... because it does work, as you can see from the image.

 

Thank you for replying.

Yes you are right.

It didn't work because I made a logical error on the other line.

And I should have thought more before I post this thread.

I'm really sorry for bothering you.

I hope you would have a great day.


LeeC2202
  • LeeC2202

    Snitch

  • Members
  • Joined: 24 Oct 2015
  • United-Kingdom

#4

Posted 4 weeks ago

No problem, glad you got it sorted.

 

Just to reassure you, it was no bother for me to reply. The only reason I wrote that reply like that, is because I know how important it is for people to be able to get answers. So my aim was to try and help you achieve that, if you have any questions in the future.

 

Modding isn't easy and sometimes, even the best modders run into problems, or have questions. A question that gets ignored can be discouraging for the person who asked it and I am a strong believer in encouraging people to create.


ES_SENCE
  • ES_SENCE

    Player Hater

  • Members
  • Joined: 4 weeks ago
  • South-Korea

#5

Posted 4 weeks ago Edited by ES_SENCE, 4 weeks ago.

No problem, glad you got it sorted.
 
Just to reassure you, it was no bother for me to reply. The only reason I wrote that reply like that, is because I know how important it is for people to be able to get answers. So my aim was to try and help you achieve that, if you have any questions in the future.
 
Modding isn't easy and sometimes, even the best modders run into problems, or have questions. A question that gets ignored can be discouraging for the person who asked it and I am a strong believer in encouraging people to create.

Now I get it. Your comments mean a lot. I really appreciate them.
Yes you did encourage me. As this is first time I start modding, when I was stuck, I found those codes then inserted them into my script.
It seemed everything worked fine except those lines. So I thought those are invalid codes so I posted this thread.
But after seeing your answer, I could think my script was wrong not those codes. So thanks to you, I debuged my script then I found the way to work properly.
So I have to say thank you so much. If you didnt reply me, I would never find how to add blips.
Sorry for my bad english though, as a not native english person.
Thank you again for spending your time to help me and saving my time too.
  • LeeC2202 likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users