Quick Number Check In Source
by Robert Fritzen · in Technical Issues · 03/15/2011 (8:08 pm) · 1 replies
Hello, this should hopefully be easy.
I need to do a quick number check for my EXP system in C++ code, but using vars stored in TS, this is what I have for a check, the numbers are encrypted using AES-256-CBC, and are decrypted before checking in this script (what ObtainDE does).
This gives me a parse error. I have also tried it like this
Like I said, this is probably alot easier than I am making it, so how can I fix this.
I need to do a quick number check for my EXP system in C++ code, but using vars stored in TS, this is what I have for a check, the numbers are encrypted using AES-256-CBC, and are decrypted before checking in this script (what ObtainDE does).
const char * currentEXP = Con::executef("ObtainDE", argv[1]);
Con::setVariable("$currentEXPForOfficerCheck", currentEXP);
if(strcmp(Con::evaluatef("\"@$currentEXPForOfficerCheck@\" > 20000000"), "0") == 0) { //check hereThis gives me a parse error. I have also tried it like this
if(strcmp(Con::evaluatef("$currentEXPForOfficerCheck > 20000000"), "0") == 0) {Like I said, this is probably alot easier than I am making it, so how can I fix this.
About the author
Illinois Grad. Retired T3D Developer / Pack Dev.
Torque Owner Robert Fritzen
Phantom Games Development
This code also sends me a parse error + invalid return:
const char * currentEXP = Con::executef("ObtainDE", argv[1]); . . . if(strcmp(Con::evaluatef("%s > 20000000", currentEXP), "0") == 0) { //ERROR HERE