Game Development Community

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).

const char * currentEXP = Con::executef("ObtainDE", argv[1]);
Con::setVariable("$currentEXPForOfficerCheck", currentEXP);

if(strcmp(Con::evaluatef("\"@$currentEXPForOfficerCheck@\" > 20000000"), "0") == 0) { //check here

This 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.

#1
03/16/2011 (5:01 pm)
Well, I looked around for evaluatef usage, and I cannot seem to find anything good.

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