Jump to content

Best scripting idea ever?? !!??


Deepu

Recommended Posts

Hey guys, I am back again, like for a few months okay?.... I am now programming some games and now I thought of telling you one idea that came to my dreams yesterday morning..

in the gui functions

guiCreateWindow(x, y, lenth, breadth......)

there, instead of 2D x and y, why don't use 3D positions? :D

do you think its possible to create a 3D GUI?

Link to comment

uhmmm.... I know quite a good list of maths bro, but uhmm, why don't u create a tangent and try to create 3D pts. with respect to that tangent touching a circle? I mean use DxDraw3dcircle( ) or something, and yeaah, can't we use C++? for MTA?

Link to comment

Haha, you're always so defensive, Deepu. You already have all the functions you need to create a 3D-like DX menu, would it be easy? No. I simply said it's possible.

If you do know math as well as you claim, why don't you go ahead and do it yourself then? :P Yes, you can use C++, MTA's module system uses C++.

Link to comment

I think you're misunderstanding the concept of Modules. You can't just execute C++ in MTA like that. You need to create your own module, in C++, and compile it as a .dll file for it to be used with MTA.

I suggest you download the Module SDK and take a look at it, to get an idea how it works.

Edit:

No scripting language would run that loop. The ; at the end of for is not valid in any language. Also no logic would touch the script, even if there weren't syntax errors. Health as a variable has already been set, so whatever it's at isn't going to change during the loop, and nothing runs alongside for loops like this unless you have some multi-threaded module, which you don't, so unless you had a class set as health that returned an updated health whenever it was called, which you just don't, that's another failure on your part. Every language has an opening structure and closing structure, for LUA it's then/do and end respectively, for most others it's { and }. You have no "do", which is the correct method for opening a code segment after for, and basically the opposite of ";" which is used to end a code statement. Also you specify that the health increases but the loop only checks to see if a value is already at or over 50 before running, ie, it would run infinitely. Finally LUA doesn't allow the final argument in for to be any basic code, it's already an int/float that will be added every step of the for loop, so -

TL;DR: You did loads of things wrong with that, things that someone who knows any language would know not to do.

  
for (i=0;getElementHealth(woundedPlayer)<50;1) do 
setElementHealth(woundedPlayer, i); 
end 
  

Would check if the player has under 50 health, and if so increment 1 at a time until they were at 50.

Link to comment
I think you're misunderstanding the concept of Modules. You can't just execute C++ in MTA like that. You need to create your own module, in C++, and compile it as a .dll file for it to be used with MTA.

I suggest you download the Module SDK and take a look at it, to get an idea how it works.

Edit:

No scripting language would run that loop. The ; at the end of for is not valid in any language. Also no logic would touch the script, even if there weren't syntax errors. Health as a variable has already been set, so whatever it's at isn't going to change during the loop, and nothing runs alongside for loops like this unless you have some multi-threaded module, which you don't, so unless you had a class set as health that returned an updated health whenever it was called, which you just don't, that's another failure on your part. Every language has an opening structure and closing structure, for LUA it's then/do and end respectively, for most others it's { and }. You have no "do", which is the correct method for opening a code segment after for, and basically the opposite of ";" which is used to end a code statement. Also you specify that the health increases but the loop only checks to see if a value is already at or over 50 before running, ie, it would run infinitely. Finally LUA doesn't allow the final argument in for to be any basic code, it's already an int/float that will be added every step of the for loop, so -

TL;DR: You did loads of things wrong with that, things that someone who knows any language would know not to do.

  
for (i=0;getElementHealth(woundedPlayer)<50;1) do 
setElementHealth(woundedPlayer, i); 
end 
  

Would check if the player has under 50 health, and if so increment 1 at a time until they were at 50.

You're wasting your time explaining all this stuff to him. He's just acting smart which I think you already know.

/I'm out

Link to comment

sam1lter thank you for the reply, you are so smart, smarter than me, thats why can you tell me in which header file of Dos C++ the pixel line creation function is? without googling? then ok.. I accept that your smart, and please, I wasn't acting too smart...

@Dealman, thanks a lot.. so now I understand why the value wasn't getting incremented...

can't u make switch cases?

like

switch(health)

{case 1 : health >= 0;

break

.

.

.

.

.

}

can't we use that? or is it predefined for the keys? (not being smart :D)

Link to comment
sam1lter thank you for the reply, you are so smart, smarter than me, thats why can you tell me in which header file of Dos C++ the pixel line creation function is? without googling? then ok.. I accept that your smart, and please, I wasn't acting too smart...

@Dealman, thanks a lot.. so now I understand why the value wasn't getting incremented...

can't u make switch cases?

like

switch(health)

{case 1 : health >= 0;

break

.

.

.

.

.

}

can't we use that? or is it predefined for the keys? (not being smart :D)

If you don't know something then just admit it. I don't script in C++. I know some basics only and I might learn more in future. While you already have MTA functions, what is the point of using C++? That's why I'm saying you're just acting smart.

Link to comment

Why are you guys having such pointless discussion over here? The languages you know nor your knowledge within these has nothing to do with one's intelligence.

Either way, using C++ actually gives you access to a larger library of functions, and also if I'm not wrong the execution time of those is slightly smaller. MTA's quite limited in this sense.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...