Raised This Month: $51 Target: $400
 12% 

Solved Difference?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-08-2022 , 17:39   Difference?
Reply With Quote #1

hello!, could someone be able to tell me the differences between these 2 options?, many variables or 1

Option 1:

PHP Code:

new __fl_gOrigin[33][3]:
new 
__fl_gOrigin2[33][3]:
new 
__fl_gOrigin3[33][3]: 
Option 2:

PHP Code:

new __fl_gOrigins[33][3][3];

/*
[0] __fl_gOrigin[33][3]:
[1] __fl_gOrigin2[33][3]:
[2] __fl_gOrigin3[33][3]:

*/ 

Last edited by MrPickles; 11-10-2022 at 20:37.
MrPickles is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-08-2022 , 19:44   Re: Difference?
Reply With Quote #2

Ask a proper question.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-08-2022 , 19:52   Re: Difference?
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Ask a proper question.
I just did it, if you don't understand the question it's not my problem, or maybe you just want to win a post, or maybe you don't know the answer, maybe all of the above
the question is very simple


https://forums.alliedmods.net/showthread.php?t=118721
"If you have something to say, triple-check if it's needed. Don't start an off topic conversation in the middle of a help request thread."

Last edited by MrPickles; 11-08-2022 at 19:59.
MrPickles is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-09-2022 , 01:45   Re: Difference?
Reply With Quote #4

They are effectively the same. Using a single variable would make it easier to loop through the three different origins though.
__________________
fysiks is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-09-2022 , 01:49   Re: Difference?
Reply With Quote #5

It depends on how you want to use them. If you want to have three floats to pick origin points, you don't need to use the second option just to save lines. Stick with the first one, more organized and easy to understand.

I guess you've chosen a bad example to explain your question. There are no difference in the final code, just how you use them, as I said before...

PHP Code:
    pev(idpev_origin__fl_gOrigin[id])
    
console_print(id"%.1f %.1f %.1f"__fl_gOrigin[id][0], __fl_gOrigin[id][1], __fl_gOrigin[id][2]) 
#2

PHP Code:
    pev(idpev_origin__fl_gOrigin[id][0])
    
console_print(id"%.1f %.1f %.1f"__fl_gOrigin[id][0][0], __fl_gOrigin[id][0][1], __fl_gOrigin[id][0][2])
    
    
pev(idpev_origin__fl_gOrigin[id][1])
    
console_print(id"%.1f %.1f %.1f"__fl_gOrigin[id][1][0], __fl_gOrigin[id][1][1], __fl_gOrigin[id][1][2])
    
    
pev(idpev_origin__fl_gOrigin[id][2])
    
console_print(id"%.1f %.1f %.1f"__fl_gOrigin[id][2][0], __fl_gOrigin[id][2][1], __fl_gOrigin[id][2][2]) 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 11-09-2022 at 01:49.
EFFx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-09-2022 , 06:22   Re: Difference?
Reply With Quote #6

Your question would be "Is it more efficient to use multiple arrays or sum up those multiple arrays into
one with more dimensions.?" The answer is : Both are the same.

I am not trying to start an argument for that, the rules simply state that you have to properly explain your question, and lets not to talk about the title of the topic.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 11-09-2022 at 12:02.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-10-2022 , 18:17   Re: Difference?
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
Your question would be "Is it more efficient to use multiple arrays or sum up those multiple arrays into
one with more dimensions.?" The answer is : Both are the same.

I am not trying to start an argument for that, the rules simply state that you have to properly explain your question, and lets not to talk about the title of the topic.


They are completely different questions, I am asking what the differences are(general), not which one is more efficient than the other,(specific) for the next time do not start a post off topic, thanks.

thanks to EFFx and fysiks, who knew how to answer in a simple and clear way, what the question is.

one thing EFFx, is that the example I gave is fine, I already knew how it is used in your examples, but I wanted to see what other differences there were in terms of creating more variables or creating 1 that would store more cells, in any case thanks


"the rules simply state that you have to properly explain your question, and lets not to talk about the title of the topic."

=>

"could someone be able to tell me the differences between these 2 options?"

I think that this question is quite clear, and the title of the post covers everything in general, which is what I ask, the differences, please do not try to win a post with these stupidities (no offense intended)

Last edited by MrPickles; 11-10-2022 at 18:20.
MrPickles is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-10-2022 , 18:58   Re: Difference?
Reply With Quote #8

It seems like you put more effort in this post than the 1st one, I am glad you did some effort.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-10-2022 , 20:29   Re: Difference?
Reply With Quote #9

Quote:
Originally Posted by Natsheh View Post
It seems like you put more effort in this post than the 1st one, I am glad you did some effort.
there are some people with mental deficiency so I have to explain with apples and pears something that is really simple, see you

"for the next time do not start a post off topic, thanks."

Last edited by MrPickles; 11-10-2022 at 20:29.
MrPickles is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-11-2022 , 00:03   Re: Difference?
Reply With Quote #10

To be fair, the title is not very descriptive.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode