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

javascript eval funciton


Post New Thread Reply   
 
Thread Tools Display Modes
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 08-15-2015 , 10:31   Re: javascript eval funciton
Reply With Quote #11

Grind out all those conditionals. I can assure you that there is a 0.001% chance that the devs will consider adding an arbitrary code evaluator function into sourcemod, for the reasons I mentioned above.

(Generally if you have to do this, there is almost-always a better way to solve the problem rather than using 50 numeric variables - have you considered using arrays for some?)
Potato Uno is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 08-15-2015 , 10:35   Re: javascript eval funciton
Reply With Quote #12

Quote:
Originally Posted by Potato Uno View Post
Grind out all those conditionals. I can assure you that there is a 0.001% chance that the devs will consider adding an arbitrary code evaluator function into sourcemod, for the reasons I mentioned above.

(Generally if you have to do this, there is almost-always a better way to solve the problem rather than using 50 numeric variables - have you considered using arrays for some?)
AND SOLUTION'S NAME IS JOHN CENA

Spoiler
__________________
...

Last edited by Oshizu; 08-15-2015 at 10:45.
Oshizu is offline
Akuba
Senior Member
Join Date: Oct 2013
Old 08-15-2015 , 18:26   Re: javascript eval funciton
Reply With Quote #13

Can someone explain what he wants to do? I do not really get it.

I know eval from php, but the numbers (what he said) confusing me.
Akuba is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 08-15-2015 , 18:35   Re: javascript eval funciton
Reply With Quote #14

Quote:
Originally Posted by Akuba View Post
Can someone explain what he wants to do? I do not really get it.

I know eval from php, but the numbers (what he said) confusing me.
Quote:
Originally Posted by nxlinux View Post
Quote:
Originally Posted by WildCard65 View Post
Let me get this straight, you want to do math operations on a variable but you only got a string to work with?
yes, because i have more than 50 variables, if i want achieve my function,i should be use if(..) else if(..) expression, it's too many!
__________________

Last edited by WildCard65; 08-15-2015 at 18:36.
WildCard65 is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 08-15-2015 , 18:43   Re: javascript eval funciton
Reply With Quote #15

Just don't use strings.

PHP Code:
new Skill[MAXPLAYERS+1][2]; //Array to hold 2 skills for every client

for (new 02i++)
{
  
Skill[Client][i]++;

__________________
11530 is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 08-15-2015 , 20:06   Re: javascript eval funciton
Reply With Quote #16

Couldn't an extension be made for something like this? Does python support these types of functions? ... is there a way to link Python to SourcePawn? So many questions!
ReFlexPoison is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 08-15-2015 , 20:11   Re: javascript eval funciton
Reply With Quote #17

You mean like Source.Python? Though, not sure what their support is, haven't had the pleasure of using it.
Maxximou5 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 20:54.


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