help with coding
-
I'm new to this
right now I'm simply trying to spawn a trailer at a coordinate after hitting F7
can anyone tell me what I'm doing wrong
I keep getting this error CS1026,') expectedhere's the line:
{
World.CreateVehicle(new Model(VehicleHash.army tanker) new Vector3(-0.0, 0.0, 0.0))
}
any references I can use to learn this terminology is appreciated because I learn faster thru examplesapologies if i posted in the wrong forum
-
@djeroc said in help with coding:
I keep getting this error CS1026,') expected
" ; expected" error tells you that something is missing, something is expected, and it tells you it is the semicolon.
The terminology, the syntax? This is the C# language and in this example the error message tells you to end the statement with a ;
For absolute coordinates, use something like
Vehicle Vehicle1 = World.CreateVehicle("Vestra", new Vector3(-1352, -3034, 14));
or
Vehicle Vehicle1 = World.CreateVehicle(VehicleHash.Vestra, new Vector3(-1352, -3034, 14));
army tanker isn't a valid name.
-
thanks for the quick response
im using the gta 5 mod creator v2.1 (Build 18981) with a templateis there any reason to believe that the values it has is out of date?
-
@djeroc said in help with coding:
is there any reason to believe that the values it has is out of date?
No idea. If you're interested in coding this is the better way.
-
i have that already. im completely green when it comes to using it. it like building a car from scratch verses modding a car you have. im better at lua
-
@djeroc said in help with coding:
im better at lua
Well, you do have Lua as an option for scripting in singleplayer, unless you're trying to learn C# or something
@djeroc said in help with coding:
I learn faster thru examples
With that in mind, you can write your script in Lua, and then if you're trying to learn C# or so, work on porting/rewriting it afterwards until it works; doing it that way gives you a working representation of the code and a reference of what you're wanting/trying to achieve (how it should kinda look or be structured) and may make it easier for you.
-
that the gist of what im doing now. i got a lua from the site called trucking jobs. it doesnt work. but seeing how its structured is giving me an understanding.